|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disabling certain url's in a menu?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 -- k***@n-sv.com.<Remove This Before Emailing> Network & Software Integration www.n-sv.com "Helping put the pieces of your IT puzzle together" 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 Show quoteHide quote "kfrost" <k***@n-sv.com.(donotspam)> wrote in message news:F003BC6B-3A78-4365-87BA-272F67DE4840@microsoft.com... > 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 > -- > k***@n-sv.com.<Remove This Before Emailing> > > Network & Software Integration > www.n-sv.com > > "Helping put the pieces of your IT puzzle together" 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. -- Show quoteHide quotek***@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" wrote: > 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 > > > -- > Teemu Keiski > ASP.NET MVP, AspInsider > Finland, EU > http://blogs.aspadvice.com/joteke > > "kfrost" <k***@n-sv.com.(donotspam)> wrote in message > news:F003BC6B-3A78-4365-87BA-272F67DE4840@microsoft.com... > > 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 > > -- > > k***@n-sv.com.<Remove This Before Emailing> > > > > Network & Software Integration > > www.n-sv.com > > > > "Helping put the pieces of your IT puzzle together" > > > 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. 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 Show quoteHide quote "kfrost" <k***@n-sv.com.(donotspam)> wrote in message news:A10B8C73-6A1A-4F67-B94A-ED8C5470F04A@microsoft.com... > 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. > > >
System.Web.HttpException FindContol exception
framed Automatic <%@Register of Web User Controls in a Project? Listbox Flicker detailsView DeleteCommand asp.net 2.0 webparts Custom Server Control Design Best Practices? Setting control focus on roundtrip TableCell: BackColor Property But No BackGround Property? How do I create a Drop Down List with Hyperlinks as List Items in ASP.NET |
|||||||||||||||||||||||