Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: MasterPages Broken in v9?

  1. #1
    Gregorius is offline Junior Member
    Join Date
    Jul 2009
    Posts
    5

    Angry MasterPages Broken in v9?

    I'm trying to upgrade from v8 to v9 at the moment.. since they're using master pages, i figured i'd take the opportunity to extend this functionality and create some master pages of my own... put header in its own page, footer in its own, etc.

    Problem is the content is not getting placed into the placeholders i've created.. the only placeholder that works is the mandatory "PageContent" one.

    Is there a reason for this?

    In my code below, plcMainContent shows the default value, but PageContent shows the page content as expected:


    C#/VB.NET Code:
    <%@ Master Language="C#" AutoEventWireup="true" Inherits="AspDotNetStorefront.MasterPageBase" %>
    <%@ 
    Register TagPrefix="aspdnsfc" Namespace="AspDotNetStorefrontControls" Assembly="AspDotNetStorefrontControls" %>
    <%@ 
    Register TagPrefix="uc" TagName="Head" Src="Template_Head.ascx" %>
    <%@ 
    Register TagPrefix="uc" TagName="Body" Src="Template_Body.ascx" %>

    <!
    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
        <
    head id="Head1" runat="server">
            <
    uc:Head runat="server" ID="ucHeadControl" />
        </
    head>
        <
    body>
            <
    asp:ContentPlaceHolder ID="plcMainContent" runat="server">
                <
    h3>Default Content</h3>
            </
    asp:ContentPlaceHolder>

            <
    div id="content">
                <!-- 
    CONTENTS START -->
                <
    asp:ContentPlaceHolder ID="PageContent" runat="server"></asp:ContentPlaceHolder>
                <!-- 
    CONTENTS END -->
            </
    div>

            <%--<
    uc:Body runat="server" ID="ucBodyControl" />      --%>
        </
    body>
    </
    html

    My code for PlcMainContent is as follows:


    C#/VB.NET Code:
    <%@ Master Language="C#" AutoEventWireup="true" MasterPageFile="~/App_Templates/Skin_1/template.master" %>

        <
    asp:Content ID="conMainBody" runat="server" ContentPlaceHolderID="plcMainContent">

            <
    h3>Inherited Content :) </h3>

        </
    asp:Content

    Any suggestions? Is this workable or am i wasting my time?

    Thanks
    Greg

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Try adding a new document to your solution and when prompted select that master page as the master page for the document. It will then scan the master page for all ContentPlaceHolders and automatically create entries for them in the page. Let us know if it creates sections of the page for each ContentPlaceHolder. On quick glance I can't see anything wrong with your code.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM