Error creating template from master page

Posted by Community Admin on 03-Aug-2018 15:10

Error creating template from master page

All Replies

Posted by Community Admin on 18-Nov-2010 00:00

Hi,
I am having a problem creating a template from a master page. Below is the error and the master page code. Any help would be much appreciated.
Cheers,
Stewart

ERROR that occurs when creating a template from the .master below
----------

Server Error in '/DemoCPG' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page) +2299
   Telerik.Sitefinity.Modules.Pages.TemplateEditorRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext) +196
   Telerik.Sitefinity.Web.RouteHandler.InitializeContent(Page handler, RequestContext requestContext) +475
   System.Web.UI.Control.LoadRecursive() +94
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2759


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


MASTER Page
-------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">
<%@ Master language="C#" %>
<html dir="ltr" xmlns="www.w3.org/.../xhtml">

<head runat="server">
    <title>AppPage</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
</head>

<body>
    <div id="masthead">
        <asp:ContentPlaceHolder id="header" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="top_nav">
        <asp:ContentPlaceHolder id="menu" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="page_content">
        <asp:ContentPlaceHolder id="content" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="footer">
        <asp:ContentPlaceHolder id="basemenu" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="copyright">2010 © AAA Inc. All rights reserved </div>
</body>

</html>

Posted by Community Admin on 22-Nov-2010 00:00

Hi Stewart Collis,

Thank you for using our services.

Can you please make sure that you have a run-at server form tag in which your content placeholders will be inserted:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Master language="C#" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
 
<head id="Head1" runat="server">
    <title>AppPage</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
</head>
 
<body>
<form runat="server">
    <div id="masthead">
        <asp:ContentPlaceHolder id="header" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="top_nav">
        <asp:ContentPlaceHolder id="menu" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="page_content">
        <asp:ContentPlaceHolder id="content" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="footer">
        <asp:ContentPlaceHolder id="basemenu" runat="server"></asp:ContentPlaceHolder>
    </div>
    <div id="copyright">2010 © AAA Inc. All rights reserved </div>
    </form>
</body>
 
</html>


Greetings,
Radoslav Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed