Copied to clipboard

Flag this post as spam?

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


  • johan 8 posts 28 karma points
    Mar 16, 2010 @ 17:31
    johan
    0

    one content placeholder dont'n work..

    Info: Umbraco 4, VS2008, ASP.NET3.5

    Hi,
    I have a base template(master), main template and a footer template. The content in the footer template renders fine but not for the main template..

    I've checked and rechecked countless times and cannot find any code errors, VS cannot find any errors either. Everythin is setup with the right templates and published etc..
    I dont get any errors when i run the site in a browser, and  umbraco don't complain either.

    Funny thing is that when i remove the CPH Footer from the master template I get error in the browser, it says it cant find the CPH FooterContent, when i do the same with the main CPH nothing happens, no error at all.

    Also if i change the id "MainContent" in the master template  to "FooterContent" the footercontent renders fine in the main div.

    Hope u can help me...

    //
    JB

    Code from the master template;

    -----------------------------------------------------------

    <div id="Main">
                <asp:ContentPlaceHolder Id="MainContent" runat="server">
                </asp:ContentPlaceHolder>
    </div>

    <div id="Footer">
                <asp:ContentPlaceHolder ID="FooterContent" runat="server">
                </asp:ContentPlaceHolder>
    </div>

    ------------------------------------------------------------

    Code from the Main template;

    --------------------------------------------------

    <%@ Master Language="C#" MasterPageFile="~/masterpages/BaseMasterPage.master" AutoEventWireup="true" CodeBehind="StartPageTemplate.master.cs" Inherits=asdf.asdf.masterpages.BaseMasterPage" %>

    <asp:Content ContentPlaceHolderId="MainContent" runat="server">
        <div id="LeftMainContainer"><umbraco:Item field="LeftMainContent" runat="server"></umbraco:Item></div>
        <div id="TopRightMainContainer"><umbraco:Item field="TopRightMainContent" runat="server"></umbraco:Item></div>
        <div id="BottomMiddleMainContainer"><umbraco:Item field="BottomMiddleMainContent" runat="server"></umbraco:Item></div>
        <div id="BottomRightMainContainer"><umbraco:Item field="BottomRightMainContent" runat="server"></umbraco:Item></div>   
    </asp:Content>

    ---------------------------------------------------

    Code from the Footer template;

    -------------------------------

    <%@ Master Language="C#" MasterPageFile="~/masterpages/BaseMasterPage.master" AutoEventWireup="true" CodeBehind="FooterTemplate.master.cs" Inherits="asdf.asdf.masterpages.BaseMasterPage"%>

    <asp:Content ContentPlaceHolderId="FooterContent" runat="server">
        <div id="LeftFooterContainer"><umbraco:Item field="LeftFooterContent" runat="server"></umbraco:Item></div>
        <div id="MiddleFooterContainer"><umbraco:Item field="MiddleFooterContent" runat="server"></umbraco:Item></div>
        <div id="RightFooterContainer"><umbraco:Item field="RightFooterContent" runat="server"></umbraco:Item></div>
    </asp:Content>

    -------------------------------

  • Amir Khan 1282 posts 2739 karma points
    Mar 16, 2010 @ 19:22
    Amir Khan
    0

    What's the code for your Base template?

  • johan 8 posts 28 karma points
    Mar 16, 2010 @ 21:01
    johan
    0

    Code from the master template;

    -----------------------------------------------------------

    <div id="Main">
                <asp:ContentPlaceHolder Id="MainContent" runat="server">
                </asp:ContentPlaceHolder>
    </div>

    <div id="Footer">
                <asp:ContentPlaceHolder ID="FooterContent" runat="server">
                </asp:ContentPlaceHolder>
    </div>

    ------------------------------------------------------------

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Mar 16, 2010 @ 21:24
    Peter Dijksterhuis
    0

    you should write ID in capitals:

    <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>

    Peter

  • johan 8 posts 28 karma points
    Mar 17, 2010 @ 01:01
    johan
    0

    No this is the naming we use..

    As for the problem it dosn't matter

  • Laurence Gillian 600 posts 1219 karma points
    Mar 17, 2010 @ 01:31
    Laurence Gillian
    0

    @Johan, Peter means on <asp:ContentPlaceHolder tags, not the Div tags! ;)

    If you look closly your tag which is function uses ID in capitols and the broken one is Id.

    Hope that fixes it for you, Lau

  • johan 8 posts 28 karma points
    Mar 17, 2010 @ 12:26
    johan
    0

    Ahh tnx I didn't see that, unfortunately it did not fix the problem.

  • johan 8 posts 28 karma points
    Mar 17, 2010 @ 14:00
    johan
    0

    Ok so ive startet from the beginning (almost) it seems i can only have one working CPH in my master template... dosent matter where it is or what it's called... i'm getting insane here..

  • johan 8 posts 28 karma points
    Mar 17, 2010 @ 19:13
    johan
    0

    Ok so now i started  a completely new installation and i still get the same error... so i suppose it has something to do with my setup.

    win 7 x64
    sqlexpress2008
    VS2008

    And i run umbraco from a VS directory not under iis7.. Any ideas?

  • Laurence Gillian 600 posts 1219 karma points
    Mar 18, 2010 @ 12:22
    Laurence Gillian
    0

    Are you wrapping your entire masterpage in a CPH, as below? L

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content id="PublicMasterContent" ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    
    <!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" xml:lang="en" lang="en">
    
    <head id="head" runat="server">
    
        <title><umbraco:Macro Alias="(get)PageTitle" runat="server"></umbraco:Macro></title>
    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta http-equiv="Content-Language" content="en" />
        <meta http-equiv="X-UA-Compatible" content="IE=7;FF=3;OtherUA=4" />
    
        <!-- site meta information - author, desc, keywords, company, copyright, rss feed-->
    
        <!-- remember to add the constant values in beneath this, e.g copyright, author, etc -->
    
        <!-- disable MS tools -->
        <meta http-equiv="imagetoolbar" content="no" />
    
        <!-- stylesheets -->
        <link rel="stylesheet" type="text/css" href="/css/Layout.css" title="SITE NAME" media="screen" />
    
        <!-- javascript entries -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
        <script type="text/javascript" src="/Scripts/JS/main.js"></script>
    
    </head>
    
    <body id="pageName">     
        <div id="container">
            <div id="header">
                <!-- Header -->
    
                <div id="nav">
                    <asp:ContentPlaceHolder ID="pcmHeader" runat="server">
                DEFAULT NAV.
            </asp:ContentPlaceHolder>
                </div>
            </div>   
    
            <!-- Start Content Link for Screen Readers, remember to implement this -->
            <a name="startcontent" id="startcontent"></a>
    
            <div id="content" class="content">
                <form id="PublicMasterForm" runat="server">
                    <asp:ContentPlaceHolder ID="pcmContent" runat="server"></asp:ContentPlaceHolder>
                </form>
            </div>
    
            <div id="footer">
                <asp:ContentPlaceHolder ID="pcmFooter" runat="server">
          SOME DEFAULT MARKUP.
          </asp:ContentPlaceHolder>
            </div>
        </div>
    
    <!-- Remember to Insert Google Analytics code here -->
    
    </body>
    
    </html>
    
    </asp:content>
  • johan 8 posts 28 karma points
    Mar 18, 2010 @ 12:33
    johan
    0

    Yes ive gone down to the very basics and this is what i have now.. still doesn't work.. and I dont use VS anymore

     

    -----------------Master  file

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
     
    <asp:ContentPlaceHolder Id="main" runat="server">
        <!-- Insert default "main" markup here -->
    </asp:ContentPlaceHolder>

    <asp:ContentPlaceHolder Id="foot" runat="server">
        <!-- Insert default "foot" markup here -->
    </asp:ContentPlaceHolder>

    </asp:Content>

     

    ------------------Main file

    <%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>

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

     

    ------------------Footer file

    <%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>

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

     

     

     

     

     

     

     

     

     

     

  • johan 8 posts 28 karma points
    Mar 18, 2010 @ 12:49
    johan
    0

    ok sry everyone this seems to be something else... i made a masterpage contentpage website in VS and got the same error... 2 bad i didn't try that 2 days ago ;(

    anyway tnx for trying to help.

  • Björn Jönsson 37 posts 58 karma points
    Mar 29, 2010 @ 08:32
    Björn Jönsson
    0

    Hi Johan!

    Have you tried to set "recursive=true" for  your umbraco field for your footer?

    --

    Björn

Please Sign in or register to post replies

Write your reply to:

Draft