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

  • Home
  • SEARCH
  • 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 3674732
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:53:25+00:00 2026-05-19T02:53:25+00:00

Current Setup I currently have three masterpages and content pages in the following hierarchy

  • 0

Current Setup

I currently have three masterpages and content pages in the following hierarchy :

  • One root-level masterpage that displays the final result. Call this "A"
  • Two sibling pages that don’t reference each other but contain all the same contentplaceholder elements, just in a different order with different <div>‘s surrounding them. Both reference the root-level masterpage. Call these "B1" and "B2".
  • Several content pages that reference one or the other sibling master pages above (not both). Call these "C1" through "C-whatever".

Basically I have:

Cn => B1 => A

Cm => B2 => A

This hierarchy works fine.

Desired Setup

What I want to do is add in a new level to this hierarchy (a new master page) between the content pages and the sibling masterpages. Basically so it’s like this:

  • One root-level masterpage that displays the final result.
  • Two sibling pages plus a third sibling. Call it B3
  • A new middle masterpage that dynamically ‘chooses’ one of the sibling masterpages. The desired behaviour is to pass through the content given by C directly to Bn without modifying it. The only thing D actively does is choose which Bn. Call this new masterpage D.
  • Several content pages that reference the new middle master page instead of the old siblings.

The challenge to this is, I’m working within the confines of a rather complex product and I cannot change the original two sibling masterpages (B1 and B2) or content pages (C) in any meaningful way.

I want:

Cn => D => B1 => A

Cm => D => B2 => A

Ck => D => B3 => A

Essentially, D should "pass through" all it’s content to whichever B-level masterpage it chooses. I can’t put this logic in the C-level pages.

Additional Details

  • All B-level pages have the same content/contentplaceholder tags, just ordered and styled differently.
  • D can be as convoluted as it has to be, so long as it doesn’t require modifying C or B.
  • I’m using ASP.Net 2.0

Is this 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-19T02:53:26+00:00Added an answer on May 19, 2026 at 2:53 am

    A MasterPage doesn’t have a Page_PreInit event, so all changes to the MasterPage hierarchy (nested or otherwise) must originate from the content page.

    So, if you can modify the content pages, add:

    void Page_PreInit(object sender, EventArgs e)
    {
        //if (someCondition)
            this.Master.MasterPageFile = "~/Path/B1.master";
        //else if (otherCondition)
            this.Master.MasterPageFile = "~/Path/B2.master";
        //etc.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my current setup. I have two pages running on the jquery mobile
Currently I have a .NET setup that many workings devs have (VS 2008, SQL
Currently in Vim I have the following setup: au Bufenter *.clj map <F5> :!clojure1.2
My current setup : I have an entity object with some properties, among them
In my current setup, I have a typedef std::function<void (MyClass&, std::vector<std::string>) MyFunction; std::map<std::string, MyFunction>
I have been reviewing the setup of a current Amazon Web Store implementation to
Our current MVC project is set up to have ViewModels that encapsulate the data
The Current Setup: So, I can use the following code to save a file
I want to setup CruiseControl.Net at my company. We currently have several .net solutions
Hi i currently have an Activity that hosts a tab view, and each tab

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.