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 935375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:08:50+00:00 2026-05-15T21:08:50+00:00

In a project I’m working on, the master page codebehind does a load of

  • 0

In a project I’m working on, the master page codebehind does a load of complex checks and confirmations that decide the navigation list displayed on the TreeView of the page. Now, I need a way to access this list from another front-end page, such as “frontpage.aspx”.

This serves two purposes. One, the masterpage will hide pages on the navigation list the user shouldn’t have access to, but the user can still enter the page by typing the page name into the URL manually. By being able to browse through the TreeView, I can isolate the whole authorization into a single method by simply checking if the page name exists within the currently used TreeView.

Two, this will allow me to easily change the displayed content of any page without checking the database or storing sessions for whatever specific rights the current user has, as I can just look if the TreeView contains “Products Admin” for example, and then use that to hide or display the section of the page that has to do with “Product Admin” functionality.

So, any tips on how to do this, or if it’s even possible?

  • 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-05-15T21:08:50+00:00Added an answer on May 15, 2026 at 9:08 pm

    Assuming that frontpage.aspx is a content page you can definitely access the master page from it.

    For example this code will find a TextBox and Label controls that are on the master page. You should be able to adapt it to find your TreeView:

    // Gets a reference to a TextBox control inside a ContentPlaceHolder
    ContentPlaceHolder mpContentPlaceHolder;
    TextBox mpTextBox;
    mpContentPlaceHolder = 
        (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
    if(mpContentPlaceHolder != null)
    {
        mpTextBox = (TextBox) mpContentPlaceHolder.FindControl("TextBox1");
        if(mpTextBox != null)
        {
            mpTextBox.Text = "TextBox found!";
        }
    }
    
    // Gets a reference to a Label control that is not in a 
    // ContentPlaceHolder control
    Label mpLabel = (Label) Master.FindControl("masterPageLabel");
    if(mpLabel != null)
    {
        Label1.Text = "Master page label = " + mpLabel.Text;
    }
    

    For more info see – http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 522k
  • Answers 522k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer getline used in that way considers just ' ' as… May 16, 2026 at 9:28 pm
  • Editorial Team
    Editorial Team added an answer I think there is no particular reason for that. java.util.Calendar… May 16, 2026 at 9:28 pm
  • Editorial Team
    Editorial Team added an answer The best and simplest way is to use the CSS3… May 16, 2026 at 9:28 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Project file here if you want to download: http://files.me.com/knyck2/918odc So I am working on
Project is C#. So I have a bunch of multithreaded code that is designed
Project#1 has some interfaces and classes that project#2 references. Now I want to use
My project requires that I update the contents of a specific column in an
The project I'm working on allows an end-user to modify CSS code to integrate
I project I have been working on has now been split between me and
A project I have been working on for the past year writes out log
Project Darkstar was the topic of the monthly JavaSIG meeting down at the Google
Project Euler and other coding contests often have a maximum time to run or
Project Scenario Technology : Dotnetnuke (Approx. 100 - 150 screens) Data Architecture : LINQ

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.