NavigateUrl is not working with SelectedNodeStyle
-
01-10-2019 - |
Question
I'm trying to get SelectedNodeStyle to work with NavigateUrl without success. The style is not applied when clicking on nodes.
<asp:TreeView ID="treeviewSIP" runat="server" ExpandDepth="0">
<SelectedNodeStyle BackColor="Red" ForeColor="WhiteSmoke"
BorderStyle="Solid" BorderWidth="1px" BorderColor="#66FF33">
</SelectedNodeStyle>
</asp:TreeView>
Node creation:
With nyNode
.NavigateUrl = "thePage.aspx?op=visa&Tabell_ID=" + viewSIP.Item(sipIndex)("TABELL_ID").ToString
.Target = "main"
.Text = viewSIP.Item(sipIndex)("NAMN")
.SelectAction = TreeNodeSelectAction.Select
theParent.ChildNodes.Add(nyNode)
End With
Any suggestions?
Solution
Did a workaround. Used TreeNode.Value instead of TreeNode.NavigateUrl and used the TreeView.SelectedItemChanged event to do the actual navigation.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow