Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Controls / April 2006

Tip: Looking for answers? Try searching our database.

Disabling certain url's in a menu?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kfrost - 29 Apr 2006 18:56 GMT
Hello,

I have a menu bound to a SiteMapDataSource which reads from my web.sitemap.

I'm using the menu in a master page and everything works fine but I need to
some of the menu items to be disabled depending on the user who is accessing
the web page.

For example I have a menu as with the follow nodes.
Freight
    Add
    Search

Certain users will only search and I want to disable the Add item.  Anybody
have any ideas as to how to go about doing this?

Thanks.

kris
Signature

kris@n-sv.com.<Remove This Before Emailing>

Network & Software Integration
www.n-sv.com

"Helping put the pieces of your IT puzzle together"

Teemu Keiski - 29 Apr 2006 19:13 GMT
Hi,

site map can be applied security settings based on in which role users is.
It is called security trimming.

See: http://msdn2.microsoft.com/en-US/library/ms178428.aspx

Signature

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

> Hello,
>
[quoted text clipped - 19 lines]
>
> kris
kfrost - 29 Apr 2006 19:58 GMT
Hmm, walked through that and I guess it's ok if you want to spend the time to
hassle through it.  Also, I'm not going to define ASP.Net Roles.  This is an
intranet application and we're using security groups to control access.

To verify authorization we use User.IsInRole("Domain\username");

I stilled try following the direction in the link you sent but with
roles="*" on the urls, adding the settings to the web.config blocks the
entire menu.  So I assume you have to enable roles which I'm not interested
in doing at this point to try and do something this simple.

So isn't there a simple way to find the menuitem or node in the datasource
and disable just disable it when the page loads?

thanks.

Signature

kris@n-sv.com.<Remove This Before Emailing>

Network & Software Integration
www.n-sv.com

"Helping put the pieces of your IT puzzle together"

> Hi,
>
[quoted text clipped - 26 lines]
> >
> > kris
kfrost - 29 Apr 2006 20:03 GMT
P.S.  To enable roles in ASP.Net 2.0, don't you need to have sqlexpress
installed on the server?  I'm not sure if the .Net 2.0 framework installs sql
express by default but sqlexpress will not be running on this server.

Again, haven't spent that much time with roles and don't really care to in
this project.

So that puts me back to the original question and is there a way to disable
a menu item or hide it programmatically when it's populated from a
web.sitemap file?

Thanks.
Teemu Keiski - 30 Apr 2006 08:41 GMT
It would create a local database into App_Data folder.

Yes, if programmatical approach is needed, you certainly can have control
via SiteMap object

For example:

SiteMap.CurrentNode.ReadOnly = True

Here is more about SiteMap:
http://msdn2.microsoft.com/en-us/library/system.web.sitemap(VS.80).aspx

Signature

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

> P.S.  To enable roles in ASP.Net 2.0, don't you need to have sqlexpress
> installed on the server?  I'm not sure if the .Net 2.0 framework installs
[quoted text clipped - 10 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.