R – Creating nested master pages in ASP.NET Web Application

asp.netmaster-pagesnested

Is it possible to create nested master pages in an ASP.NET Web Application projects as one can do in ASP.NET Website projects?

I am using Visual Studio 2008 and working on an ASP.NET Web Application. While creating a master page there is no option to choose another master page which if was available would have allowed me to create nested master pages.

Have anyone faced similar issue? Is any sort of work around recommended?

Thanks in advance for any help. Cheers.

Best Answer

Yes, from version 2 of the .NET framework, nested master pages have been supported. One caveat is that you won't get design time support in Visual Studio 2005 if you have nested master pages. This isn't an issue in VS 2008.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="SecondLevelMaster.master.cs" Inherits="SecondLevelMaster" **MasterPageFile="~/RootMaster.master"** %>