User-534056067 posted
Hi Janet, you might want to study the sample at
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitem.selected.aspx. Notice how the menu tag has a convenient attribute, onmenuitemdatabound, that lets you wire up a function that gets executed for each menu item in your menu as it
gets databound. As the example shows, you can use that function to examine whatever properties you wish for the current menu item. Based on those properties (using whatever logic you think is correct for your situation) you can set the Selected property of
one of the menu items.
The adapters will honor the Selected property however it gets set. There is logic within the adapters that facilitates that postback situation because, well, that's necessary in order for the adapters to work. When you are working in a situtation (like you
described) where you are simply building a menu to do plain, old HTTP GET requests on your site, then you have to "manually" set the "selected" page using logic wired up to the onmenuitemdatabound event.
I believe if you wire your menu to a sitemap datasource the menu item gets selected automatically. If you are creating a menu more "manually" with asp:menuitem tags or binding to some other sort of data source you probably can simply add some logic in the
onmenuitemdatabound event and things will work for you.
Best regards,