Reputation: 3955
If I already created a bunch of views is there any way to change their layout pages?
Upvotes: 0
Views: 78
Reputation: 17540
You can change the default layout page for the whole application in the file _ViewStart.cshtml. By default it has the the following code:
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
This specifies that if any of your views do not explicitly state which layout to use they will use this layout.
Or, you can add code to your views (like above) that explicitly states which layout to use.
Upvotes: 1