Sitefinity 4: Null Reference When Editing Templates
I experienced a "duh" moment today while trying to tackle an error I was receiving while playing with the Sitefinity 4 RC (due out later this week!). Whenever I created a template, I’d always get the following error when I tried to edit it:
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.
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.
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page) +1804 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
I kept thinking it was a bug in the RC, or perhaps because I needed to build my project or because it was a Web Applicaiton Project and not a Web Site, as I’m used to working with…
Turns out this was once again another example of my tendency to be a complete bonehead.
Since I was using a free css template (courtesy of STUDIO7DESIGNS) I simply copied and pasted the HTML into my master page. Unfortunately I neglected to replace the <form runat=”server” > tag that is required by ASP.NET master pages to function properly!
Talk about duh. Sorry about that. I’m posting this in case I ever make this mistake again (and God knows, I will), when I search for the answer online, I’ll no doubt find the answer on my own blog!
Latest posts by selaromdotnet (see all)
- Adding Ratings and Reviews to Sitecore Commerce with YotPo - November 13, 2018
- Sourcetree Suddenly Prompting for Github Credentials - February 22, 2018
- Xamarin Forms: Public C# Properties Missing on Android - June 19, 2017