MasterPage in MasterPage?

I'm wondering if there is a way to implement something like this:

A site has two pages with subpages. The top two pages use the same MasterPage but, depending on the top page, I'd like to have the same layout within the original MasterPage. E.g., let's say there is an audio page and a blog page. The audio page may have a menu of its own with categories, which the same for all audio pages, but still resides within the top-level MasterPage, and the same for the blog pages. Simply put - is there a way to have MasterPage's within ContentPlaceHolders?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You cannot put MasterPages withing ContentPlaceHolders, but you can nest MasterPages.  In this model, you would have three Master Pages:


Using three masters ensures that the design is consistent throughout. In this case, Page.Master.Master would always return the SiteMaster master page.

In the SiteMaster master page, you expose all the ContentPlaceHolders that you need.  Then, in DefaultPageMaster and in AudioPageMaster you must create new ContentPlaceHolders within Content blocks corresponding to the SiteMaster's ContentPlaceHolders.  A page cannot directly use the ContentPlaceHolders of an indirect master page.

An alternative to this method would be to include a user web control on each of your audio pages.

Note as well that ASP.NET 2.0 supports multiple master pages, but Visual Studio 2005 does not support them in design view.  This doesn't prevent you using them, and VS 2008 and Expression Web both support multiple master pages.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thanks for the points :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.