I have a strange problem that on some of the pages off my site, "CurrentPage" is null and I get an error "Cannot perform runtime binding on a null reference" if I try and access any dynamic properties. On some other pages it works fine though. I can't see any difference between thet pages it works on and the ones that it doesn't.
I'm using umbraco 7.1.4 and this is on a standard razor template (not a marco partial) that begins with @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
CurrentPage is null on some pages
I have a strange problem that on some of the pages off my site, "CurrentPage" is null and I get an error "Cannot perform runtime binding on a null reference" if I try and access any dynamic properties. On some other pages it works fine though. I can't see any difference between thet pages it works on and the ones that it doesn't.
I'm using umbraco 7.1.4 and this is on a standard razor template (not a marco partial) that begins with @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
Any idea why?
Thanks
Ok, I've solved this. It's because I had a controller with the same name and it was using that instead of UmbracoTemplatePage.
More details here: http://our.umbraco.org/documentation/Reference/Mvc/custom-controllers
Thanks janS :)
is working on a reply...