How to Create a View in ASP.NET MVC ?

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.
Pin It

One thought on “How to Create a View in ASP.NET MVC ?

  1. Pingback: Interesting .NET Links - February 19 , 2013 | TechBlog

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>