Set all razor views to inherit from Umbraco.Web.Mvc.UmbracoTemplatePage
Im trying to make all razor views inherit from Umbraco.Web.Mvc.UmbracoTemplatePage. So that I dont have to have @inherits Umbraco.Web.Mvc.UmbracoTemplatePage at the top of every page.
Adding Umbraco.Web.Mvc.UmbracoTemplatePage to pageBaseType in the web.config in the Views folder kind of works..
Problem is that I want Model.Content to be static, but it becomes dynamic so I dont get any intellisence :( Is there a way to make it static (as it would be if I've added Umbraco.Web.Mvc.UmbracoTemplatePage at the top of the razor file)?
If you have Umbraco.Web.Mvc.UmbracoTemplatePage at the top of your _Layout View, then any views which inherit from this will inherit from UmbracoTemplatePage.
That's how I'd do it.
Also, doing it this way means you can override the model on any specific view just by adding the @inherits on that/those view(s) in case your model is different on some pages.
Set all razor views to inherit from Umbraco.Web.Mvc.UmbracoTemplatePage
Im trying to make all razor views inherit from
Umbraco.Web.Mvc.UmbracoTemplatePage
. So that I dont have to have@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
at the top of every page.Adding
Umbraco.Web.Mvc.UmbracoTemplatePage
to pageBaseType in the web.config in the Views folder kind of works..Problem is that I want Model.Content to be static, but it becomes dynamic so I dont get any intellisence :( Is there a way to make it static (as it would be if I've added Umbraco.Web.Mvc.UmbracoTemplatePage at the top of the razor file)?
shameful bump.
If you have
Umbraco.Web.Mvc.UmbracoTemplatePage
at the top of your _Layout View, then any views which inherit from this will inherit from UmbracoTemplatePage.That's how I'd do it.
Also, doing it this way means you can override the model on any specific view just by adding the @inherits on that/those view(s) in case your model is different on some pages.
Close your view and re-open to get the intellisence. This is working fine in MVC 4
is working on a reply...