Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

vb asp.net master page tree view problem

$
0
0

ok i have a Tree view at the side of the master page.

if i use treeview properties and manually add in nodes, no matter which content page i went to, the nodes will not change.

but if i fill in nodes with codes at contentpage1 and went to any other page.

the treeview nodes will disappear. why is this so? i tot the treeview was at master, as long as i don clear them away at other page, it should be stay there untill i tell them to do so.

Dim tv1 As TreeView
            tv1 = CType(Master.FindControl("tvside"), TreeView)

            If Not tv1 Is Nothing Then

                Dim i As Integer = 1
                tv1.Nodes.Clear()
                Do While dr.Read
                    Dim tnode As New TreeNode
                    tnode.Value = dr.Item(2).ToString
                    tv1.Nodes.Add(tnode)
                    AddHandler tv1.SelectedNodeChanged, AddressOf tv1_SelectedNodeChanged
                Loop
            End If




Viewing all articles
Browse latest Browse all 23244

Trending Articles