How to implement Master Pages in ASP.NET MVC

We can use 'Layouts' as master pages in ASP.NET MVC.

We can implement layouts using different ways in ASP.NET MVC. I am explaining two ways here.

1. you can pass layout through action result return statements.

 return View("Home", "_commonLayout", model);

2. Define Layout on top of each view.

@{
 Layout = "~/Views/Home/_HomeLayout.cshtml";
}


Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar