Is it possible to configure Razor to look for “master” layout files named other than _ViewStart.cshtml? I mean, without explicitly setting the Layout property in the content templates.
In the project I’m working on, each area has its own _ViewStart.cshtml. On top of them there’s a “global” _ViewStart.cshtml. This works fine, but I think it would be more convenient if I could assign different names for each master template, like calling the “global” template _GlobalViewStart.cshtml. That way it would be easier to spot each file when there are many of them open on the Visual Studio ribbon. (Silly? Perhaps.)
If it’s possible, how can one do it?
Thanks.
It’s hard coded in the
RazorViewEngineas “_ViewStart” so I doubt it unless you compile your own version.You could define your own base View that changes Layout to whatever you want so you don’t have to modify it on every view.