Greetings,
I am currently working on our company's website that consists of two sets of navigational groups.
The first group is of course the
main menu set to the left side of the page vertically, and the second group is the
sub menu set on top of the page horizontally.
The
main menu is using a TreeView control and the
sub menu is setup in a simple "html"
tag with the basic "html"
link tags.
I used the TreeView control because it gave me more functionality for expanding and collapsing the nodes when the user navigated throughout the web site.
Actually I was able to search and find some code that would only expand the nodes depending on the parent node selected, and collapses the other nodes.
Here is that code:
Protected Sub TreeView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeView1.DataBound
TreeView1.CollapseAll()
Dim tn As TreeNode = TreeView1.SelectedNode
tn.Expand()
If tn.Parent IsNot Nothing Then
tn = tn.Parent
tn.Expand()
End If
End Sub
Now my problem is when the user selects a link in the
sub menu it has a
Null value. Is there a better way to do this when expanding the TreeView nodes. I must have a separate navigation menu different from the
main menu? I do like how the
main menu is working and did not want to change it. Any type of help would be really appreciative!
Thank you