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

Discussion in 'ASP .Net Building Controls' started by Sri Reddy, May 2, 2006.

  1. Sri Reddy

    Sri Reddy Guest

    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
     
    Sri Reddy, May 2, 2006
    #1
    1. Advertisements

  2. Sri Reddy

    Brock Allen Guest

    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 Allen, May 3, 2006
    #2
    1. Advertisements

  3. Sri Reddy

    Jules Guest

    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
     
    Jules, Jun 21, 2006
    #3
  4. Sri Reddy

    Jules Guest

    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
     
    Jules, Jun 21, 2006
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.