Placeholder in Root Layout using MVC - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Placeholder in Root Layout using MVC

  • Placeholder in Root Layout using MVC
  •      I am using MVC for my layout templates. I have placeholders in both the root and the nested templates. I am able to add content to the placeholders when creating a page. But when I view those pages the content is not inserted.

    Here is an example of my templates.

    Root.cshtml 

    <html>
       <head>
       </head>
       <body>
          <div class="sfPublicWrapper" id="PublicWrapper">
              <div>
                 @Html.SfPlaceHolder("TopNavigation")
             </div>
             @RenderBody()
             <div>
                 @Html.SfPlaceHolder("Footer")
             </div>
          </div>
        </body>
    </html>

    Nested.cshtml

    @
        Layout = "~/Mvc/Views/Shared/AssociateRoot.cshtml";
     
    @Html.SfPlaceHolder("ModalContent")
     
    @Html.SfPlaceHolder("InnerContent")
    <div>More Content</div>

    Any content put in the Footer placeholder or the navigation placeholder is not displayed. Any content placed in ModalContent or InnerContent does display. No errors are received that I can see.

  • Hi Jeff. Nesting and placeholders working really bad together. You can check similar thread: www.sitefinity.com/.../nested-layouts-not-working-with-section-helpers