Hi,
I just want to know which is better option whether i should use master page or _layout.cshtml View In MVC
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 23, 2014, 6:03 AM
hi,
Agree with Jaganathan.
Selection is depending on View engine are you going to use. A view engine is basically what takes the view and renders the necessary HTML. Razor uses the _layout.chtml file and it's own tempting system that is similar to master pages.
Please refer below link to more about layout page
http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx
hope this will help you.
Jaganathan BantheswaranPosted Jan 23, 2014, 4:32 AM
Both are same except that the order in which the page is rendered. In Razor engine, the inner most sections are rendered first but in WebForms, the Outer [master page] is rendered first.
In Master page of WebForms, you can have holders for html but in Layout of Razor, you may have Sections.