How to apply a Layout for a View in ASP.NET MVC ?

Published on March 30, 2013 by Senthil Kumar

Filed under ASP.NET

Last modified March 30, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 5 (1 votes)

This article have been viewed 9542 times

In the previous article , step by step procedure was provided on How to Create Layout in ASP.NET MVC Project ? . This article will explain how to apply a layout to a View in ASP.NET MVC.

How to apply a Layout for a View in ASP.NET MVC ?

The View has a property called “Layout” . This “Layout” property needs to be set in case the View needs to have a layout.

Below is a sample View where the Layout is setout for it.

@model AbundantCodeModel.Articles


Layout = “~/Views/_Layout1.cshtml”;


Programming Article Title: @Model.Title

1 Comment

  1. Interesting .NET Links – March 31 , 3013 | TechBlog
    March 31, 2013 - 2:18 pm

Leave a Comment


You might be Interested in these Posts

How to read connection string from web.config in ASP.NET and C# ?

Here's a sample code snippet demonstrating how to get the connection string from your ASP.NET

How to return Json instead of XML in ASP.NET Web API ?

When you make a call to the ASP.NET Web API action method and notice this in Google Chrome browser ,...

How to Add Web API to existing ASP.NET Web Forms Project ?

In one of the previous posts , we saw how to add the WebAPI to the existing ASP.NET MVC project. Wel...