I have Sitefinity 8.0.
I added a Custom Root Template resolver to my project:
I registered it in the Application_Start of the Global asax file:
I then created a template, choose MVC only, created a page based on that template (I didn't add any widgets to the page), published the page, then chose View Page from the Pages screen.
I get the following error:
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Sitefinity.Web.PageRouteHandler.handler_PreRenderComplete(Object sender, EventArgs e) +913
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +121
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1155
Anyone know why this is happening?
My code above is based on the sample code here:
Has anyone been able to successfully implement a custom MVC Root Template resolver?
I really need to get this to work...
The code in the sample is not entirely correct.
The solution is: <head> needs the runat="server" attribute. Also, delete the <title> element.