Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:24:47+00:00 2026-06-18T16:24:47+00:00

We would like to manipulate an ASP.Net TreeView that’s in a Master Page from

  • 0

We would like to manipulate an ASP.Net TreeView that’s in a Master Page from a different web page.

This coding is from the Master Page web form code-behind file. We would like to duplicate this coding in a Page_Load event of another web page’s code-behind file. When I try to use this coding in the other web form,

objTreeView = Knowledge_Academy1.loginView.FindControl("TreeViewMain")

we get an error that states loginView is protected. How do we unprotect it so I can duplicate the same coding?

Here is the working coding from the master web form code-behind file:

Public Class Knowledge_Academy1
    Inherits System.Web.UI.MasterPage

Protected Sub TreeViewMain_TreeNodeExpanded(sender As Object, e As TreeNodeEventArgs)

    Dim objTreeView As TreeView
    objTreeView = loginView.FindControl("TreeViewMain")

    Select Case e.Node.Text

        Case "Maintenance"

            ' Make sure all nodes except for Maintenance are collapsed.
            '----------------------------------------------------------
            For Each treenode As TreeNode In objTreeView.Nodes
                If treenode.Text = "Parents" Or
                    treenode.Text = "Students" Or
                    treenode.Text = "Financial" Then

                    treenode.Collapse()
                End If
            Next treenode

        Case "Students"

            ' Make sure all nodes except for Students are collapsed.
            '-------------------------------------------------------
            For Each treenode As TreeNode In objTreeView.Nodes
                If treenode.Text = "Parents" Or
                    treenode.Text = "Maintenance" Or
                    treenode.Text = "Financial" Then

                    treenode.Collapse()
                End If
            Next treenode

        Case "Parents"

            ' Make sure all nodes except for Parents are collapsed.
            '------------------------------------------------------
            For Each treenode As TreeNode In objTreeView.Nodes
                If treenode.Text = "Students" Or
                    treenode.Text = "Maintenance" Or
                    treenode.Text = "Financial" Then

                    treenode.Collapse()
                End If
            Next treenode

        Case "Financial"

            ' Make sure all nodes except for Financial are collapsed.
            '--------------------------------------------------------
            For Each treenode As TreeNode In objTreeView.Nodes
                If treenode.Text = "Parents" Or
                    treenode.Text = "Maintenance" Or
                    treenode.Text = "Students" Then

                    treenode.Collapse()
                End If
            Next treenode
        Case Else

    End Select
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:24:48+00:00Added an answer on June 18, 2026 at 4:24 pm

    I would suggest looking at this MSDN article: http://msdn.microsoft.com/en-us/library/xxwa0ff0(VS.80).aspx

    So for example:

    Dim mpTreeview As Treeview
    
    mpTreeview = CType(Master.FindControl("TreeViewMain"), Treeview)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im familiar with asp.net web forms. I would now like to move on to
I would like to know if there are any ASP.NET MVC control suites from
My application I have an application design that looks like this: web application layer
I'm having some problems with implementing javascript controls in my asp.net page. I would
I'd like to have an asp.net textbox that people can paste content into and
I'm currently developing a web application in ASP.Net with SQL Server and I would
String xpath = //center/div; I would like to manipulate the above string so that
I have a 320x480 PNG that I would like to texture map/manipulate on the
I would like to have a My_Events page, which only display events that current
I have an iframe loading a page, and I would like to manipulate the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.