Copied to clipboard

Flag this post as spam?

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


  • Jaivy Daam 5 posts 20 karma points
    Jul 08, 2009 @ 12:32
    Jaivy Daam
    0

    Masterpage Error.

    Hello Umbraco lovers(A),

    I am using Umbraco V4 With ASP 2.0 on a Windowx XP With IIS7.

    [HttpException (0x80004005): Inhoudsbesturingselementen moeten besturingselementen op hoofdniveau zijn in een inhoudspagina of een geneste hoofdpagina waarin wordt verwezen naar een hoofdpagina.]
    System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +428
    System.Web.UI.MasterPage.get_Master() +36
    System.Web.UI.MasterPage.ApplyMasterRecursive(MasterPage master, IList appliedMasterFilePaths) +23
    System.Web.UI.Page.ApplyMasterPage() +2074111
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +685<br /></pre> </span>

    I was watching the 2nd video Templates as we created a master page I ran into this error. I couldn't get this one right and it's getting me frustrated already.

    I will post my masterpage here and my homepage.

    This is my masterpage:

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

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <html>
    <head>

    <title>Our Website: <umbraco:Item field="pageName" runat="server"></umbraco:Item></title>

    </head>
    <body>

    <asp:ContentPlaceHolder runat="server" id="MasterContentPlaceHolder" /> 

    </body>
    </html>
    </asp:Content>


    And this is my Homepage:

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

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


    I hope this was some usefull information.

    Thanks in advance,

    Jaivy Daam.

  • Nico Lubbers 151 posts 175 karma points
    Jul 08, 2009 @ 12:40
    Nico Lubbers
    0

    In the homepage template I do not see a tag asp:content using the contentplaceholder on the master. That might cause this problem.

    Try adding

    <asp:Content ID="content1" ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    </asp:Content>

    and

    <asp:Content ID="content2" ContentPlaceHolderID="MasterContentPlaceHolder" runat="server">
    </asp:Content>

    and place your items inside the asp:content tags

    Nico

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 08, 2009 @ 12:45
    Jan Skovgaard
    1

    Hmm I am not that good at dutch but I am guessing that you have problems with the masterpage inheritance? ;-)

    You have not placed the contentplaceholder tag (<asp:ContentPlaceHolder runat="server" id="MasterContentPlaceHolder" /> ) in your homepage template and I think that is why you get the error.

    Try doing this in your homepage template instead

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

    <asp:ContentPlaceHolder runat="server" id="MasterContentPlaceHolder">
    <h1><umbraco:Item field="pageName" runat="server"></umbraco:Item></h1>
    <umbraco:Item field="bodyText" runat="server"></umbraco:Item>
    </asp:ContentPlaceholder>

    Does this help?

     

    /Jan

  • Jaivy Daam 5 posts 20 karma points
    Jul 08, 2009 @ 12:51
    Jaivy Daam
    0

    After following your advice this is my next error (i'm such a newb):

    Parser-fout

            &lt;span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">
    
            <strong> Beschrijving: </strong>Er
    

    is een fout opgetreden bij het parseren van een bron die vereist is om aan deze aanvraag te voldoen. Raadpleeg de volgende details van deze parser-fout en pas het bronbestand waar nodig aan.

            <strong> Parser-foutbericht: </strong>Inhoudsbesturingselementen
    

    moeten besturingselementen op hoofdniveau zijn in een inhoudspagina of een geneste hoofdpagina waarin wordt verwezen naar een hoofdpagina.

            <strong>Fout in bron:</strong> <br /&gt;&lt;br /&gt;
    
            &lt;table border="0" width="100%" bgcolor="#ffffcc">
               &lt;tbody&gt;&lt;tr>
                  &lt;td>
                      <pre>Regel 9:  &lt;/head&gt;<br /&gt;Regel 10: &lt;body&gt;&lt;br /&gt;&lt;span style="color: red;">Regel 11: &lt;asp:Content ID="content2" ContentPlaceHolderID="MasterContentPlaceHolder" runat="server"&gt;&lt;br /&gt;&lt;/span>Regel 12: &lt;/asp:Content&gt;<br /&gt;Regel 13: &lt;/pre&gt;
    

    </td> </tr> </tbody> </table> </span>

    
                
    Bronbestand: /masterpages/Master.master    Regel: 11

    Help!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 08, 2009 @ 12:54
    Jan Skovgaard
    0

    Could maybe try to install the runway module for Umbraco, which you can do under the developer section, and then have a look at how the templates for this package is structured?

    I think that could be helpfull and maybe even easier to understand.

  • Bart de Jonge 29 posts 51 karma points
    Jul 08, 2009 @ 13:16
    Bart de Jonge
    0

    Hello Daan,

    Your homepage should look like this:

    <%@ Master Language="C#" MasterPageFile="/masterpages/KanaalInnerMaster.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="lMasterContentPlaceHolder" runat="server">
    fields go here
    </asp:Content>

     

    hope this helps..;

    cheers Bart

  • Bart de Jonge 29 posts 51 karma points
    Jul 08, 2009 @ 13:17
    Bart de Jonge
    1

    sorry it should look like this :-)

    <%@ Master Language="C#" MasterPageFile="/masterpages/KanaalInnerMaster.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="MasterContentPlaceHolder" runat="server">
    fields go here
    </asp:Content>

    this inserts the homepage in te masterpage:

    ContentPlaceHolderID="MasterContentPlaceHolder"
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 08, 2009 @ 13:20
    Jan Skovgaard
    0

    Ah yes it is not <asp:contentHolder>, which I did suggest. Sorry about that!

  • Jaivy Daam 5 posts 20 karma points
    Jul 08, 2009 @ 13:22
    Jaivy Daam
    0

    Wel, i tried all, but still the error on line 11 with <asp:Content ContentPlaceHolderID="MasterContentPlaceHolder" runat="server">

    Is still the same :(

    Am i that stupid :S??

    The rule is in my Master Template.

    Thnx All for helping me out, it is stupid i still didn't figured it out!

  • Vladimir Dobrov 45 posts 167 karma points
    Jul 08, 2009 @ 13:28
    Vladimir Dobrov
    1

    Jaivy,

    I guess you have some kind of misunderstanding how Masters inheritance works.

    For example you have your master page with some layout. If you want to inherit it and load content into this Master page you should define a ContentPlaceholder in it. It can be done in this way :

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

    Then in the template that inherits your master you should define content section that will be loaded into master's placeholder (that one was defined above). So your child page should contain the following code.

    <asp:Content ContentPlaceHolderID="placeholder1" runat="server">

    <!-- your content goes here -->

    </asp:Content>

    IMPORTANT: ContentPlaceHolderID property in child template MUST be the same as placeholder's ID property in master page.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 08, 2009 @ 13:57
    Douglas Robar
    0

    You're getting good advice on how asp:Content and asp:ContentPlaceHolder tags work.

    A default umbraco installation would probably have the following for your top-most template.

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

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">

    </asp:Content>

    Adding the code from your original example, I think the following would work for you. I'll assume you saved this template by the name of 'Master'.</p> <pre class="prettyprint"><pre class="prettyprint"><%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"><br /><span class="str"> <html>
    <head>
    <title>Our Website: <umbraco:Item field="</span><span class="pln">pageName</span><span class="str">" runat="</span><span class="pln">server</span><span class="str">"></umbraco:Item></title>
    </head>
    <body>
    <asp:ContentPlaceHolder runat="</span><span class="pln">server</span><span class="str">" id="</span><span class="typ">MasterContentPlaceHolder</span><span class="str">" />  
    </body>
    </html>
    </asp:Content></span>

    For the child template, from your original example, be sure to select the 'Master' template in the Template dialog. This will automatically update the &lt;%@ line with the proper MasterPageFile path (I've guessed what it will be in my code sample below, but selecting it and saving the template will ensure it is correct) and will show the child template nested below the parent template in the treeview on the left.

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

    ><</span><span class="pln">umbraco</span><span class="pun">:</span><span class="typ">Item</span><span class="pln"> field</span><span class="pun">=</span><span class="str">"pageName"</span><span class="pln"> runat</span><span class="pun">=</span><span class="str">"server"</span><span class="pun">></</span><span class="pln">umbraco</span><span class="pun">:</span><span class="typ">Item</span><span class="pun">></</span><span class="pln">h1</span><span class="pun">></span><span class="pln"><br /></span><span class="pun"><</span><span class="pln">umbraco</span><span class="pun">:</span><span class="typ">Item</span><span class="pln"> field</span><span class="pun">=</span><span class="str">"bodyText"</span><span class="pln"> runat</span><span class="pun">=</span><span class="str">"server"</span><span class="pun">></</span><span class="pln">umbraco</span><span class="pun">:</span><span class="typ">Item</span><span class="pun">></span><span class="pln"><br /></span>

    </asp:Content>

    Let us know what you find out.

    Cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 08, 2009 @ 14:04
    Douglas Robar
    0

    Well, that formatting didn't work at all, did it? Let's try again...Main/Parent/"Master" template with your code:</strong></span>

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

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
      <html>
        <head>
          <title>Our Website: <umbraco:Item field="pageName" runat="server"></umbraco:Item></title>
        </head>
        <body>
          <asp:ContentPlaceHolder runat="server" id="MasterContentPlaceHolder" /> 
        </body>
      </html>
    </asp:Content>

     Child template with your code:</strong></span>

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

    <asp:Content ContentPlaceHolderID="MasterContentPlaceHolder" runat="server">
      <h1><umbraco:Item field="pageName" runat="server"></umbraco:Item></h1>
      <umbraco:Item field="bodyText" runat="server"></umbraco:Item>
    </asp:Content>

     

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jul 08, 2009 @ 14:05
    Douglas Robar
    0

    Please ignore the nasty formatting. At least the code came out properly.

    cheers,
    doug.

  • Jaivy Daam 5 posts 20 karma points
    Jul 08, 2009 @ 14:39
    Jaivy Daam
    0

    I've got the Awnser, The code on line 11 was a wrong code i used <asp:content> Instead of <asp:ContentPlaceHolder>.

    I thank you all for helping me out and you've all been a great help!

    Thanks(L)uall!

    Jaive.

Please Sign in or register to post replies

Write your reply to:

Draft