K
Karl
I've got an ASP:Menu on a MasterPage so that the menu shows on all
pages that use the masterpage
The menu is loaded from a site map and works well. Whenever I navigate
around using the menu, the correct class/style is applied to the
relevant menu item, showing which page I'm on.
However, I want to highlight a menu item when I am on a sub page of a
menu item, but cant seem to find how to reference the menu items in
code (C Sharp) so that at runtime the menu highlights as selected the
root page for the section of the site im in.
For instance, I have a menu that has just 8 root level options (but no
child menu items) so that these are shown across the top of my site
such as...
[Menu Item One | Menu Item Two | Menu Item Three | etc etc etc]
if I click Menu Item Three, then the correct page is shown and this
menu item is highlighted using CSS. but if this page has a sub page,
say a details page for an item selected on this page, called
"MenuItemThreeChildOne.aspx" I still want Menu Item Three on the menu
to be highlighted.
I am trying to do this in code, either on the masterpage or the
relevant child page, but cant seem to find the items in the menu no
matter when I look for them. I can use "FindControl" to get the menu,
but it always has 0 items.
Can anyone tell me how I'd find the item I want to set as selected
properly?
Thanks
pages that use the masterpage
The menu is loaded from a site map and works well. Whenever I navigate
around using the menu, the correct class/style is applied to the
relevant menu item, showing which page I'm on.
However, I want to highlight a menu item when I am on a sub page of a
menu item, but cant seem to find how to reference the menu items in
code (C Sharp) so that at runtime the menu highlights as selected the
root page for the section of the site im in.
For instance, I have a menu that has just 8 root level options (but no
child menu items) so that these are shown across the top of my site
such as...
[Menu Item One | Menu Item Two | Menu Item Three | etc etc etc]
if I click Menu Item Three, then the correct page is shown and this
menu item is highlighted using CSS. but if this page has a sub page,
say a details page for an item selected on this page, called
"MenuItemThreeChildOne.aspx" I still want Menu Item Three on the menu
to be highlighted.
I am trying to do this in code, either on the masterpage or the
relevant child page, but cant seem to find the items in the menu no
matter when I look for them. I can use "FindControl" to get the menu,
but it always has 0 items.
Can anyone tell me how I'd find the item I want to set as selected
properly?
Thanks