Dot Net Stuff

Exploring Layouts, RenderBody, RenderSection and RenderPage in ASP.NET MVC

One of the major requirements for our web application is to maintain a consistent look and feel across all of the pages within your web-site/application. ASP.NET 2.0 introduced the concept of “Master Pages” which helps enable this when using .aspx based pages or templates. To achieve this concept in ASP.NET MVC application, Razor View Engine supports this concept with a feature called “layouts”- which allow us to define a common site template, and then inherit its look and feel across all the views/pages on our site. Following code sample show the basic structure of Layout.cshtml file. [Continue Reading]