Hello,
i use the WebDataMenu with a WebHierarchicalDataSource. On a Click of an Menu-Item, i use the Navigate-Url to sent a Query-String to the same page and load different content. But on each Postback, not only the content also the Menu is loaded. So How can i expand the Menu to some level and select a Node in code behind?
thanks,
Patric
Ok, i changed my page so there is a content area and the WebDataMenu. I now catch the 'Item-Click' in codebehind and load with a Ado.Net Datareader some Data and bind it to the content area.
I changed the behavior of the WebDataMenu so it expand automatical on Hover and 'CloseMenuOnClick' = False. But if the page load some new data in the content area, no menu item is selected or expanded.
What is my error??
Hello page,
Thank you for posting in the community.
Your WebDataMenu is most likely being reloaded due to the query string changes themselves (it is interpreting it as an entirely new URL). Using an Application variable however, you can persist the selection by handling the ItemSelected and DataBound events. For instance:
Please let me know if this helps.