Views
In the MVC pattern, a View is meant to display the application data to the user and handle user interaction. View helps us to implement the separation of concern design principle in MVC applications, by separating the user interface from business logic. It is an HTML page with additional Razor markup apart from the HTML markup, as we have seen earlier in this chapter. The .cshtml files are Views and treated as web pages. For example, if we create a simple MVC application, it creates a View under the Views folder and each View is associated with a controller. In the following example, HomeController is calling three Views—Index, About, and Contact . Inside the Views folder, we have a sub-folder with the controller name (Home) and this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access