I'm currently using this syntax to specify a custom Razor page base class and model type:
@inherits MyWebViewPage<MyModel>
Newer builds of Razor support a new directive to simplify this code:
@model MyModel
I'd like to use this but I can't find a way to make it work with my custom base class. Is there a way to specify this at a global level for my site?
In views/web.config modify
<pages pageBaseType="System.Web.Mvc.WebViewPage">
to your class
Tried to specify this in Views/Web.config
?
<system.web.webPages.razor>
<pages pageBaseType="MyUberCustomBaseClass">
</pages>
</system.web.webPages.razor>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With