About MVC
- Abbreviation of MVC is model-view-controller.
- Model-view-controller (MVC) is a framework for developing web applications.
- The main use of MVC to create complex web application development easy.
- In MVC we have separate view and code, so it is easy to manage.
- Asp.net MVC is stateless application.
Asp.net MVC components
MVC has 3 components
- Model
- View
- Controller
Model
Model component is the business layer. We create model classes in MVC to create poco classes and we define properties in poco classes. Model classes is used to retrieve data from the database. We can use data annotation in these classes to maintain the validation.
View
View component is used to display the UI on browser. In MVC for designing UI we use razor classes and the syntax is. csHtml.
Controller
It Manage interaction between Model and view. A controller is nothing but a class file that contains the methods of logics.

How MVC works
When we hit URL 1st the request goes to controller action method. Controller action method fetches the data from the model classes and passes, data to the respective View. The view displays the data to the end user as UI on browser.
