+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Misleading error when no Form tag in template

Misleading error when no Form tag in template

4 posts, 0 answered
  1. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    14 Jan 2008
    Link to this post
    Hi,
    Yesterday I was strugling to create a new template for Sitefinity. I converted it from one of Free CSS Templates and only put several ContentPlaceHolders. After uploading to SF and clickind "Edit this template" button I got NullReferenceException. 

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Cms.Web.EditPage.CreateChildControls() +268
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +41
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
    

    It took me a while to figure it out, but the problem was simply that I haven't included the <form> tag required for ASP.NET.

    So at least for me this error was quite missleading and I hope you can came up with a better error handling to catch this.
     
    Best Regards,
    Szymon
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    14 Jan 2008
    Link to this post
    Hi Szymon,

    Please note that every Sitefinity template is assigned to a given .master page, that should be created according to the requirements for creating master pages in .NET 2.0. In addition to the @ Master directive, the master page should contain all of the top-level HTML elements for a page, such as html, head, and form (for more details refer to MSDN library). You can also find useful information on this matter in the User Manual -> Working with Page Templates.

    Hope this helps.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    14 Jan 2008
    Link to this post
    Hi Pepi,

    Thanks for a prompt reply. I'm well aware of the ASP.NET requirements for master pages, but it quite easy to make this mistake when converting existing HTML template (as it was in my case). I'm just suggesting that it would be nice if you could add a more helpful error message in such case.

    Regards,
    Szymon
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    15 Jan 2008
    Link to this post
    Hi Szymon,

    Thanks a lot for the suggestion. We will take it into consideration for future versions.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered