ASP.NET MVC View
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.
This file has following default code.
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.
Next TopicASP.NET MVC Validation