<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[errore su treeview]]></title><description><![CDATA[<p dir="auto">Ciao<br />
ho una pagina master con un controllo treeview che però mi dà errore......mentre se lo eseguo in pagina aspx normale con VB associato finziona tranquillamente........<br />
vi posto il codice:<br />
pagina VB:</p>
<pre><code>Partial Public Class template
    Inherits MasterPage

    Dim temp As String
    Dim cont As Integer
    Protected Sub Menu_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim nodo As New TreeNode
            NodoPrincipale(nodo, 1)
            TreeView1.Nodes.Add(nodo)

            nodo.Text = "MENU"

            'nodo.Target = ""
            TreeView1.CollapseAll()
            TreeView1.Nodes(0).Expand()
            ' MsgBox.Show(Me.lbCodiceOrdine.ID.ToString(), Page)
        End If
    End Sub
    Private Sub NodoPrincipale(ByVal nodo As TreeNode, ByVal codicePadre As Integer)
        Try
            Dim da As New OleDbDataAdapter
            Dim ds As New DataSet
            Dim strsql As String = "SELECT Collegamento, Titolo,codice,url,TARGET,images FROM MENU Where codicepadre='" + CStr(codicePadre) + "' ORDER BY Codice"
            da = New OleDbDataAdapter(strsql, objdb)
            da.Fill(ds, "menu")
            'Dim Cmd As New OleDbCommand("SELECT Collegamento, Titolo,codice,url,TARGET,images FROM MENU Where [EMAIL="codicepadre=@CodicePadre"]codicepadre=@CodicePadre[/EMAIL] ORDER BY Codice", objdb)
            'Cmd.CommandType = CommandType.Text
            Dim dtable As DataTable = ds.Tables("menu")
            'Dim currRows() As DataRow = dtable.Select(Nothing, Nothing, DataViewRowState.CurrentRows)
           
            For Each rowTipo As DataRow In dtable.Select(Nothing, Nothing, DataViewRowState.CurrentRows)
                Dim nodeTipo As System.Web.UI.WebControls.TreeNode = New System.Web.UI.WebControls.TreeNode
                If IsDBNull((rowTipo("Url"))) Then
                    nodeTipo.NavigateUrl = ""
                Else
                    nodeTipo.NavigateUrl = rowTipo("Url")
                End If
                If IsDBNull((rowTipo("TARGET"))) Then
                    nodeTipo.Target = "_self"
                Else
                    nodeTipo.Target = rowTipo("TARGET")
                End If
                If IsDBNull((rowTipo("images"))) Then
                    nodeTipo.ImageUrl = ""
                Else
                    nodeTipo.ImageUrl = rowTipo("images")
                End If
                nodeTipo.Text = rowTipo("Titolo")

                If IsDBNull((rowTipo("collegamento"))) Then
                    temp = 0 + rowTipo("codice")
                Else
                    temp = rowTipo("collegamento")
                End If
                nodeTipo.Value = temp
                nodeTipo.ToolTip = rowTipo("codice")
                nodo.ChildNodes.Add(nodeTipo)
                If Not IsDBNull((rowTipo("collegamento"))) Then
                    NodoPrincipale(nodeTipo, temp)
                End If
            Next
        Catch ex As Exception
        End Try
    End Sub
    
   
    Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TreeView1.SelectedNodeChanged
        

        If TreeView1.SelectedNode.Expanded.ToString() = True Then
            TreeView1.SelectedNode.Collapse()
        Else
            TreeView1.SelectedNode.Expand()
                   End If
    End Sub
End Class
</code></pre>
<p dir="auto">pagina asp con controllo treeview</p>
<pre><code>&lt;table style="width: 208px" border="0"&gt;
            &lt;tr&gt;
                &lt;td style="width: 204px"&gt;
     &lt;asp:TreeView ID="TreeView1"  runat="server" Height="550px" Width="152px" 
                Font-Size="12pt" 
            style="font-family: 'Times New Roman', Times, serif;font-size: small" 
                ImageSet="Simple" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" BackColor="GhostWhite" Font-Names="Arial" Font-Strikeout="False" ForeColor="DimGray"&gt;
            &lt;selectednodestyle Font-Names="Arial" Font-Size="12pt" ForeColor="DimGray" /&gt;
         &lt;ParentNodeStyle Font-Names="Arial" Font-Underline="True" ForeColor="DimGray" /&gt;
         &lt;HoverNodeStyle BackColor="White" /&gt;
         &lt;NodeStyle BackColor="Transparent" /&gt;
        &lt;/asp:TreeView&gt;   
                &lt;/td&gt;
               
            &lt;/tr&gt;
          
           
        &lt;/table&gt;
</code></pre>
<p dir="auto">errore che mi viene</p>
<pre><code>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
Compiler Error Message: BC30456: 'TreeView1_SelectedNodeChanged' is not a member of 'ASP.template_master'.
Line 47:             &lt;tr&gt;
Line 48:                 &lt;td style="width: 204px"&gt;
Line 49:      &lt;asp:TreeView ID="TreeView1"  runat="server" Height="550px" Width="152px" 
Line 50:                 Font-Size="12pt" 
Line 51:             style="font-family: 'Times New Roman', Times, serif;font-size: small"
</code></pre>
<p dir="auto">vi prego aiutatemi..........</p>
]]></description><link>https://dev.connect.gt/topic/54413/errore-su-treeview</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 22:11:56 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/54413.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Nov 2007 14:15:41 GMT</pubDate><ttl>60</ttl></channel></rss>