I have a custom navigation control that applies a CSS class to the selected node, and I'm running into an issue with the selection getting applied when someone goes to the page group URL and is redirected to the first page's content. Because this redirection maintains the group URL and not the content page's URL, my control isn't correctly picking up the selection.
The StartingUrl property above is set when the control is used and is what restricts the navigation nodes that are displayed. The problem is that when a page group is clicked, the SelectedNode property doesn't show up in the list as it's the value of the StartingUrl.
Is there a clean way to work around this? Or is this bug going to be addressed in the SP1 release coming out this week?
Posted by Community Admin on 01-Mar-2011 00:00
Answered my own question. This code appears to work:
protectedvoidPage_Load(objectsender, EventArgs e)
SiteMapDataSource1.StartingNodeUrl = StartingUrl;
var currentNode = SiteMapBase.GetActualCurrentNode(); // RadSiteMap1.SelectedNode;
var selected = RadSiteMap1.Nodes.FindNodeByText(currentNode.Title);