-
Notifications
You must be signed in to change notification settings - Fork 5
Set default layout
simplic edited this page Feb 15, 2016
·
1 revision
To set the default layout you can use a view different methods.
To set the default layout for the current asp.net mvc application just call
aspnet.Views.set_layout('~/Views/Shared/_Layout.cshtml'). The path in set_layout has to point to your layout file.
Create a file with the name _ViewStart.cshtml in your Views directory. This file has to look like this:
@inherits System.Web.Mvc.ViewStartPage
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}The path has to point to your layout file.
At the top of every .cshtml file you can specify the layout to use. Just set the layout attribute like this:
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}IronPython AspNet MVC is used to make the Asp.Net MVC framework available for IronPython.