Wednesday, January 4, 2017

Part 21 - Layout View in Asp.net MVC


What is Layout View?
o    Layouts are used to maintain a consistent look and feel across multiple views within ASP.NET MVC application.
o   The layout view can be considered as the MasterPage.
o   Child pages are rendered through RenderBody() method.
o   All script and css file reference can be placed in layout page and can be accessible through all child pages.
o   Layout pages consist various methods which help to render script, css, page, and section.
o   Following are the main methods which are frequently used in layout
a.   @Styles.Render()
b.   @Scripts.Render()
c.   @RenderBody()
d.   @RenderSection()
e.   @RenderPage()
f.    @Html.RenderPartial()


General architecture of layout view


Structure of Layout




Layout is nothing but an html page which have all html tags .A layout consist the header, footer, and body section.



All Code Factory


No comments: