Set item.selected in ASP.NET Menu Control
- by BillB
ASP.NET newbie here. When on a page I'd like to set the corresponding menu item to selected. My approach is this:
On Home.aspx.cs:
Menu menu = (Menu)Master.FindControl("Menu1");
if (menu.Items.Count > 0)
{
menu.FindItem("Home").Selected = true;
}
Trouble is, menu.item.count == 0.
My menu is bound to a sitemap, if that matters.
Thanks,
Bill