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




    *** Sent via Developersdex http://www.developersdex.com ***
     
    Sri Reddy, May 2, 2006
    #1
    1. Advertising

  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
    http://staff.develop.com/ballen


    > 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
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    Brock Allen, May 3, 2006
    #2
    1. Advertising

  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




    "Brock Allen" <> wrote in message
    news:...
    > 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
    >> 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
    >> *** Sent via Developersdex http://www.developersdex.com ***
    >>

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

    "Brock Allen" <> wrote in message
    news:...
    > 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
    >> 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
    >> *** Sent via Developersdex http://www.developersdex.com ***
    >>

    >
    >
     
    Jules, Jun 21, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesper Stocholm
    Replies:
    2
    Views:
    8,168
    John Saunders
    Aug 23, 2003
  2. =?Utf-8?B?am9iaSBqb3k=?=

    Tivoli Vs ASP.NET2 on Role/Membership management

    =?Utf-8?B?am9iaSBqb3k=?=, Dec 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    697
    Cowboy \(Gregory A. Beamer\)
    Dec 8, 2005
  3. Sri Reddy
    Replies:
    5
    Views:
    6,394
    prashiddha
    Dec 15, 2011
  4. Kursat
    Replies:
    1
    Views:
    331
    Dominick Baier
    May 7, 2007
  5. Sri Reddy

    Dynamic Menu Control in ASP.NET2

    Sri Reddy, May 2, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    481
    Kelly Leahy
    May 2, 2006
Loading...

Share This Page