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 / Building Controls / June 2006

Tip: Looking for answers? Try searching our database.

Asp.net2 Menu control dynamic display based on User Role!!!Help please!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sri Reddy - 02 May 2006 17:30 GMT
Hi
I want to create a horizontal menu on my website being built using
asp.net2 with menu items based on the "role" of the user who logged into
the system.Role iformation will be read from database...

For ex:
for a user with "Admin" role, i would like to show "Menu Item1", "Menu
Item2", "Menu Item3", "Menu Item4". Where as if the user belongs to
"Help-desk" role, i would like to show only "Menu Item1" and "Menu
Item3"...

Also, i want to provide an alternative to access "Menu Items" if the
java-script is disabled...

Wondering what options do i got....
Thanks
Sri
Brock Allen - 03 May 2006 14:42 GMT
You could provide altername web.sitemaps files for each role, then configure
multiple XmlSiteMapProviders in web.config, then dynamically assign the ProviderName
property to the SiteMapDataSource based upon the role.

-Brock
http://staff.develop.com/ballen

> Hi
> I want to create a horizontal menu on my website being built using
[quoted text clipped - 13 lines]
> Sri
> *** Sent via Developersdex http://www.developersdex.com ***
Jules - 21 Jun 2006 18:01 GMT
hi

i hope i understand your problem. for each type of role, you would like to
show a specific menu. ok, try this

<siteMapNode url="gohere.aspx" title="You are here" description="You cannot
see me" roles ="Admin" />

as you can see, you can add the role that is allow to see the menu. only
users with the role admin will be able to see the menu"you are here"

happy programming!!!

Jules

> You could provide altername web.sitemaps files for each role, then
> configure multiple XmlSiteMapProviders in web.config, then dynamically
[quoted text clipped - 21 lines]
>> Sri
>> *** Sent via Developersdex http://www.developersdex.com ***
Jules - 21 Jun 2006 18:09 GMT
hey

i forgot to add that if you want to menu to be horizontal instead of
vertical, check the properties of the menu and there is a property
"Orientation" change it to what ever you want.

happy programming!!!
Jules

> You could provide altername web.sitemaps files for each role, then
> configure multiple XmlSiteMapProviders in web.config, then dynamically
[quoted text clipped - 21 lines]
>> Sri
>> *** Sent via Developersdex http://www.developersdex.com ***

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



©2009 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.