I think this is your scenario:
- ASP.NET Core w / MVC
- Using Folder
\Areas - You want to set the template used by all areas in one place.
To do this, you must have the following project layout:
\Areas\Home
\Areas\Home\Controllers
\Areas\Home\Views
\Areas\_ViewStart.cshtml
\Views
\Views\Shared\
\Views\Shared\_Layout1.cshtml
\Views\Shared\_Layout2.cshtml
Then in the file \Areas\_ViewStart.cshtmlyou can get the following:
@{
Layout = "_Layout1";
}
\Views\Shared\_Layout1.cshtml.
. _ViewStart.cshtml :
\Views\_ViewStart.cshtml
\Views\Shared\_ViewStart.cshtml
. _ViewStart.cshtml :
\Areas\Home\_ViewStart.cshtml
. _ViewImports.cshtml