I’m just making the switch from webforms to Razor, and I’m pretty excited. While I’m doing all the refactoring of the views, I was wondering if it is possible to extend off the Razor base view. What I’m imagining is that all the views inherit a custom base view that extends (implements?) the Razor base.
If it is possible, then how would I go about it?
Thanks
Yes, it possible with ViewStart… You can have _ViewStart.cshtml file in each subfolder and it will be base view for that subfolder…
Here is some information about it
http://weblogs.asp.net/gunnarpeipman/archive/2010/10/10/asp-net-mvc-3-beta-view-start-files-for-razor-view-engine.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=605