Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
  1. La community italiana di SEO, marketing digitale e AI
  2. Categorie
  3. Coding e Sistemistica
  4. Coding
  5. errore su treeview

errore su treeview

Pianificato Fissato Bloccato Spostato Coding
1 Post 1 Autori 1.0k Visualizzazioni 1 Seguito
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • S
    S
    sabrinef
    scritto su ultima modifica di
    User 0
    #1
    errore su treeview

    Ciao
    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........
    vi posto il codice:
    pagina VB:

    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
    

    pagina asp con controllo treeview

    <table style="width: 208px" border="0">
                <tr>
                    <td style="width: 204px">
         <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">
                <selectednodestyle Font-Names="Arial" Font-Size="12pt" ForeColor="DimGray" />
             <ParentNodeStyle Font-Names="Arial" Font-Underline="True" ForeColor="DimGray" />
             <HoverNodeStyle BackColor="White" />
             <NodeStyle BackColor="Transparent" />
            </asp:TreeView>   
                    </td>
                   
                </tr>
              
               
            </table>
    

    errore che mi viene

    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:             <tr>
    Line 48:                 <td style="width: 204px">
    Line 49:      <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"
    

    vi prego aiutatemi..........

    1 Risposta Ultima Risposta
    Miglior risposta 0
    0

    Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

    Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

    Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

    Registrati Accedi
    Rispondi
    • Risposta alla discussione
    Effettua l'accesso per rispondere
    • Da Vecchi a Nuovi
    • Da Nuovi a Vecchi
    • Più Voti


    • Accedi

    • Non hai un account? Registrati

    • Accedi o registrati per effettuare la ricerca.
    • Primo post
      Ultimo post
    Home Accedi Registrati
    Menu
    • CATEGORIES
    • La Community Connect.gt
    • Presentati alla Community
    • News Ufficiali da Connect.gt
    • Internet News
    • A Scuola Di
    • Digital Marketing
    • Intelligenza Artificiale
    • SEO & GEO
    • Web Marketing e Content
    • Google Analytics e Web Analytics
    • Google Ads & Advertising
    • YouTube
    • TikTok, Instagram e altri Social
    • Google Adsense, Affiliazioni e Guadagno
    • E-Commerce
    • Coding e Sistemistica
    • Help Center: consigli per il tuo progetto
    • Hosting e Cloud
    • Coding
    • CMS & Piattaforme Self-Hosted
    • Annunci e Collaborazioni
    • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
    • Collaborazioni WEB e Lavoro: offro e cerco
    • Impresa, Fisco e Leggi
    • Consulenza Legale e Professioni Web
    • Consulenza Fiscale, Imprese, Startup e P.Iva
    • Gli Off Topic
    • PC, Smartphone e altri Hardware
    • Tutti i Software
    • GT Fetish Cafè
    • Discussioni
    • Non letti 0
    • Recenti
    • Hashtag
    • Popolare
    • Utenti
    • Privacy
    • Termini e condizioni
    • © 2026 Search On Media Group S.r.l.