Back to the main page
Can't find the answer? Ask
Submit Articles
Publish your articles and reach thousands of readers worldwide.
Publish
■ Welcome Guest, LogIn
■ Connexion avec 
Category : Computers & Internet » Programming » .Net | Posted by : Malek | Posted on : 3/11/2009 | Updated on : 3/11/2009
Keywords : visual, one, need, masterpage, based, problem, root, content, another, studio, by, im, some, pages, inside, place
How To Place A MasterPage inside a MasterPage ?
In my project i have a root MasterPage, and i need another MasterPage based on the first one to be used by some content pages.

The problem is that Visual Studio doesn’t do this automatically (i’m using Visual Studio 2008, with .net 3.5), so here’s how to do it (i assume you have setup your Main MasterPage) :

1/ Create the second masterpage and select the Main MasterPage

2/ Create a content page and select the Second MasterPage as a MasterPage

3/ in The Second MasterPage insert this line into the Content Tag :

<asp:ContentPlaceHolder id="cpx" runat="server"></asp:ContentPlaceHolder>

4/ In the content page add this tag :

<asp:Content ID="c1" ContentPlaceHolderID="cpx" Runat="Server">My final page</asp:Content>

That’s all, and following this logic you can setup many levels of MasterPages.
© Daxii.com
Add a Comment
Comment as a guest or ( Login / Create an account )
Full name : e-mail :  * will not be displayed
Retype the picture text
Add your comment

Other languages : Wisdia in English English, Wisdia en Français Français, Wisdia en Español Español, Wisdia in Deutsch Deutsche, Wisdia in Italiano Italiano. Terms of use | Privacy Policy | Help © Wisdia 2008-2010, All rights reserved.