How to Create a View in ASP.NET MVC ?

Published on February 18, 2013 by abundantcode

Filed under ASP.NET

Last modified February 18, 2013

Print this page

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

This article have been viewed 3113 times

Every Web Applications needs to have the UI through which the user can interact with . You can easily create a View in ASP.NET MVC by following the below steps.

How to Create a View in ASP.NET MVC ?

1. Right Click on the Action Method in the Controller and click “Add View” in the context menu.

How to Create a View in ASP.NET MVC ?

How to Create a View in ASP.NET MVC ?

2. In the Add View Dialog , give a name for the View and select the View Engine that you wish to use for the current View from the View engine dropdown list. You can also select the layout or the master page for the View. If the view is a strongly typed view , you could select the Model Class and Scaffold template by checking the “Create a a strongly-typed view” and click “Add” button.

How to Create a View in ASP.NET MVC ?

How to Create a View in ASP.NET MVC ?

3. A new file with the specified name will now be added to the Views folder . You can start entering the markup for the UI in the view now .

Sample View

@{

ViewBag.Title = "Index";

}

<h2>AbundantCode.com</h2>

@Html.Label("AbundantCode.com - a Programming Directory")
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

1 Comment

  1. Interesting .NET Links – February 19 , 2013 | TechBlog
    June 21, 2014 - 9:26 pm

Leave a Comment


x

You might be Interested in these Posts

How to set default value for Html.TextBoxFor in ASP.NET MVC ?

You can set the default value for the Html.TextBoxFor extension controls in ASP.NET MVC by specifyin...

ASP.NET MVC and View State

The ASP.NET Web Forms includes the Server Controls which generally retains the state of the controls...

How to return Http Status Code from ASP.NET Web API Controller ?

There are times when you might want to return the Http Status code from an action method of a ASP.NE...