Menu control StaticSelectedStyle with submenus

Last post 06-08-2009 2:01 PM by skrish08820. 1 replies.

Sort Posts:

  • Menu control StaticSelectedStyle with submenus

    06-08-2009, 10:48 AM
    • Member
      12 point Member
    • wegass
    • Member since 02-12-2009, 4:44 PM
    • Gothenburg Sweden
    • Posts 36

    I have a question regarding the menu control (sitemap based). On a site I'm developing, In the the top menu which reside inside a masterpage I have the selected menu item

    StaticSelectedStyle //edit// Backcolor set to yellow. I also use HTML "submenues" (text in red), under some main menu sections.

    http://food.dejtingdate.se/living-food/principals.aspx

    I'm looking for a way to control the menu so that the main menu items StaticSelectedStyle  //edit// Backcolor remain yellow, when the user enters the "submenu" pages.

    How can I achieve this ?

    Fresh fish
  • Re: Menu control StaticSelectedStyle with submenus

    06-08-2009, 2:01 PM
    Answer
    • Participant
      1,298 point Participant
    • skrish08820
    • Member since 05-06-2009, 10:14 PM
    • Posts 209

    You can achieve this via CSS. You should remember that a  menu control can either navigate to a linked page or post back to the server and not both. If the navigateurl is set then the control navigates to the page. If you are using sitemap then you may have filled up the url in the sitemap which means that the control is navigating to the page. In this case, you have to code to traverse through the menu control to identify the page and then its parent pages to set the css.  Use the MenuItem class for this.

     

    Subramanian

    "You do not have to know everything. However, you have to be relentless when a need arises"
Page 1 of 1 (2 items)