More in this section
Forums / Designing with Sitefinity / Nested masterpage default content

Nested masterpage default content

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. Phil BS
    Phil BS avatar
    3 posts
    16 Jul 2009
    21 Jul 2009
    Link to this post
    Hi all

    I have a masterpage and then a nested master page, when I edit the nestedmaster page how do I default the content from the masterpage so that I don't have to keep adding the same controls to the nested master?

    eg masterpage:
    <contentplaceholder id="topnav" />

    eg nestedmasterpag:
    <contentplaceholder id="col1" />

    I want the nestedmasterpage to default the content for topnav

    any ideas?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    22 Jul 2009
    Link to this post
    Hi Phil BS,

    Below is a sample that shows how to set nested masterpage.

    1. Create a master page.

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MyTestMaster.master.cs" Inherits="App_Master_MyTestMaster" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
    <html xmlns=""
    <head runat="server"
        <asp:ContentPlaceHolder id="head" runat="server"
        <form id="form1" runat="server"
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"
            <asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server"
             <asp:Label ID="lbl1" runat="server" Text="this is my master page cph 2"></asp:Label> 

    2. Create a nested master page.

    <%@ Master Language="C#" MasterPageFile="~/App_Master/MyTestMaster.master" AutoEventWireup="true" CodeFile="MyNestedTestMaster.master.cs" Inherits="App_Master_MyNestedTestMaster" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"

    Note that the highlighted ContentPlaceholder with ID= "ContentPlaceHolder2" does not exist in the nested page as declaration. This makes the Label control visible in the nested page.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Duncan
    Duncan avatar
    1 posts
    31 Aug 2012
    31 Aug 2012
    Link to this post
    I have a similar issue, but one order of magnitude deeper...
    I have several nested masters (Global -> Section -> Sub-site -> [page]), what I want to do is set default content at the highest levels possible, but then be able to override it at the grand-child (or lower) level.

    Basically I want to be able to set default content on the Global.master page and then selectively override it at the page level, or the sub-site level.

    Can this be done?
Register for webinar
3 posts, 0 answered