Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 06, 2012 05:59 PM by JohnLocke
Member
118 Points
425 Posts
Apr 06, 2012 05:50 PM|LINK
Hi,
I want create 2 _Layout.cshtml. and i want dsiplay some views with _Layout1.cshtml and other views with _Layout2.cshtml
How can i do that?
/
lakmal
All-Star
27434 Points
4891 Posts
MVP
Apr 06, 2012 05:54 PM|LINK
The view has a Layout property -- you can just assign that to be the layout you want:
@{
Layout = "~/Views/Shared/Layout1.cshtml";
}
Contributor
3008 Points
686 Posts
Apr 06, 2012 05:59 PM|LINK
You can also choose the layout from the "Add View" wizard. Toward the bottom there's a "Use a layout or master page" option. You can click the "..." button next to the field and find the layout you want to use for that view.
gslakmal
Member
118 Points
425 Posts
How can i create 2 _Layout.cshtml and mange it in different views
Apr 06, 2012 05:50 PM|LINK
Hi,
I want create 2 _Layout.cshtml. and i want dsiplay some views with _Layout1.cshtml and other views with _Layout2.cshtml
How can i do that?
/
lakmal
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: How can i create 2 _Layout.cshtml and mange it in different views
Apr 06, 2012 05:54 PM|LINK
The view has a Layout property -- you can just assign that to be the layout you want:
@{
Layout = "~/Views/Shared/Layout1.cshtml";
}
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
JohnLocke
Contributor
3008 Points
686 Posts
Re: How can i create 2 _Layout.cshtml and mange it in different views
Apr 06, 2012 05:59 PM|LINK
You can also choose the layout from the "Add View" wizard. Toward the bottom there's a "Use a layout or master page" option. You can click the "..." button next to the field and find the layout you want to use for that view.