I am trying to create a menu that sorts differently depending on what the user role is.
For example, if the user is an Admin role, the menu shown will be:
AdminPane
RegisterUser
UserRoles
and if the user is Basic role:
ViewProducts
makeOrder
This is a layout example.
I would appreciate some help as I’ve been searching the net for 2 hours with no luck.
Thanks.
What you want to do is in your web.config have a section in your
system.websection, like so:Then with this, you’ll have three site map providers defined, each pointing to their respective
sitemapfiles for the necessary menu you are looking for for each user type.Then you’ll have a
SiteMapDataSourcethat your menu server control will use. This will most likely exist on your master page. On yourPage_Load()of your master page you’ll have logic to dynamically and programmatically set the sitemap data source of yourSiteMapDataSourcecontrol: