I\'m using ASP.NET MVC 3 with Razor views. When you want to create a view you can choose a layout (master page) for your view, or leave it to choose Default (_Layout).
I
After creating your view in the top of cshtml file you can see your layout included.
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
You can simply replace that for example with different layout
@{
Layout = "~/Views/Shared/_Layout2.cshtml";
}
Also, you can store this in the base layout (_ViewStart.cshtml
) and then all your views will use that layout.