Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brad 94 posts 151 karma points
    Feb 14, 2010 @ 05:21
    Brad
    0

    Cannot find ContentPlaceHolder 'ContentPlaceHolderDefault' ??

     

    I have just created a fresh install of Umbraco 4.0.3 and have hit an odd error. So far I have created a Master template and two Doc Types that use that master template. 

    However when I run the site, I get this error.

    Cannot find ContentPlaceHolder 'ContentPlaceHolderDefault' in the master page '/masterpages/Master.master', verify content control's ContentPlaceHolderID attribute in the content page.

     

    I there you can see Umbraco in the background with the 'Master' teplate selected. That ContentPlaceHolder does exist.

    In one of the Doc Type templates you can see it shares the same ContentPlaceHolder name.

     

     What is going on here? This is the start of the 3rd Umbraco site I have done and I have never seen this happen before.

     

     

  • Brad 94 posts 151 karma points
    Feb 14, 2010 @ 05:24
    Brad
    0

    For some reason this forum stripped out my image tags..

    I'lll try again..

    You can see the images at...(you may have to copy and paste them from here)

    http://www.users.on.net/~bradford/Images/Umbraco/UmbracoError1.jpg

    and

    http://www.users.on.net/~bradford/Images/Umbraco/UmbracoError2.jpg

    here goes..

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Feb 14, 2010 @ 07:41
    Aaron Powell
    1

    Content placeholder ID's aren't recursive, if the direct parent doesn't have a <asp:Content ID="ContentPlaceholderDefault" runat="server" /> then you will receive the error.

    The umbraco 'default' masterpage has that Content Placeholder, but my assumption is that you haven't created it in your Master.master file.

    When you create a new masterpage from the Umbraco UI it uses a standard template, it doesn't look at the specified parent to create the appropriate Content Placeholders (like Visual Studio does).

  • Brad 94 posts 151 karma points
    Feb 14, 2010 @ 12:01
    Brad
    0

    I got it sussed.

    The Master Template was created first, and  put one of these

    <umbraco:Item field="bodyText" runat="server"></umbraco:Item>

    in it at the spot I wanted the content of the pages to appear. Wrong.

    It needed to be this..

     <asp:ContentPlaceHolder Id="masterContentPlaceHolder" runat="server"/>

    Then in the Home Doc type and the Page Doc type templates, I just had to do this.

    <asp:Content ContentPlaceHolderId="MasterContentPlaceHolder" runat="server">
        <umbraco:Item field="bodyText" runat="server"></umbraco:Item>
    </asp:Content>

    I think I understand why to got this error but I'm not sure why it happened at all (how I could have messed it up so much).  At least I'll know where to start looking it happens again :)

     

     

     

  • lincolnv 1 post 21 karma points
    Apr 16, 2012 @ 19:44
    lincolnv
    0

    I encountered a similar error first time after install Umbraco by WebMatrix today. The error come when accessing the 'Company Blog Post' page.

    Cannot find ContentPlaceHolder 'cp_header' in the master page '/masterpages/umbMaster', verify content control's ContentPlaceHolderID attribute in the content page

     Diving into Settings > Templates > Starterkit Master: Blog post page. I find this .js container with 'cp_head' id

    <asp:Content ContentPlaceHolderId="cp_head" runat="server">
      <script type="text/javascript" src="/umbraco_client/ui/jquery.js">script>
      <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js">script>
    asp:Content>

    while in the 'Starterkit master' page (alias umbMaster) id of the corresponding element is: HeadContent , changing the first line above to:

    <asp:Content ContentPlaceHolderId="HeadContentrunat="server">

    solves the mismatching.

    You can check the source code of the 'Company blog post' to see all these .js go into the same place.

     

Please Sign in or register to post replies

Write your reply to:

Draft