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

S

Sri Reddy

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
 
B

Brock Allen

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.
 
J

Jules

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
 
J

Jules

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top