Javatpoint Logo
Javatpoint Logo


The MVC View is a standard HTML page that may contain script. It is used to create web pages for the application. Unlike ASP.NET Web Pages, MVC Views are mapped to the action and then controller renders the view to the browser.

MVC has certain conventions for project structure. The view file should be located in the subdirectory of View folder.

MVC uses Razor view engine so that we can write server side code in HTML as well. Let's create a view and execute it to the browser.

Creating View to the Application

To add view, right click on the subfolder inside the View folder and select Add-> Add View. It will pop up for the view name etc.

ASP View 1

This file has following default code.

// Welcome.cshtml

If we want to execute it, we have a controller like this:

This controller has Welcome action method that will render Welcome view file to the browser. Right click on the Welcome.cshtml file and select view in browser. This will produce the following output.


ASP View 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA