C
coynej60
I have a number of treeviews on a webpage which are populated with a
couple of links as child nodes at runtime. The problem I am having is
when I click on the root node of any of the trees I get the same page
except I now have 2 of each tree! I have not been able to find anyone
else who is having this issue. See below the code I use to populate
the trees. Has anyone else had this problem and have a solution?
1)
....
reader = cmd.ExecuteReader()
Dim root As New TreeNode("Tests and Procedures")
root.NavigateUrl = ""
'build the tandp related content tree
While (reader.Read() And i < 3)
i = i + 1
Dim nodeChild As New TreeNode
nodeChild.Text = reader.Item("page_title")
nodeChild.NavigateUrl = "content.aspx?pageid=" &
reader.Item("pageid")
root.ChildNodes.Add(nodeChild)
'create the "More Tests and Procedures" tree node
End While
If (root.ChildNodes.Count > 0) Then
treeTandP.Nodes.Add(root)
treeTandP.Visible = True
End If
treeTandP.CollapseAll() 'collapse the tree to start with
Note I have tried setting the navigateurl property to an empty string
as well as not changing the property from it's default value and get
the same result either way.
thanks,
Jake
couple of links as child nodes at runtime. The problem I am having is
when I click on the root node of any of the trees I get the same page
except I now have 2 of each tree! I have not been able to find anyone
else who is having this issue. See below the code I use to populate
the trees. Has anyone else had this problem and have a solution?
1)
....
reader = cmd.ExecuteReader()
Dim root As New TreeNode("Tests and Procedures")
root.NavigateUrl = ""
'build the tandp related content tree
While (reader.Read() And i < 3)
i = i + 1
Dim nodeChild As New TreeNode
nodeChild.Text = reader.Item("page_title")
nodeChild.NavigateUrl = "content.aspx?pageid=" &
reader.Item("pageid")
root.ChildNodes.Add(nodeChild)
'create the "More Tests and Procedures" tree node
End While
If (root.ChildNodes.Count > 0) Then
treeTandP.Nodes.Add(root)
treeTandP.Visible = True
End If
treeTandP.CollapseAll() 'collapse the tree to start with
Note I have tried setting the navigateurl property to an empty string
as well as not changing the property from it's default value and get
the same result either way.
thanks,
Jake