8 Mar 2017

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";
}


No comments:

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.