ASP.NET MVC Framework
MVC is an architectural pattern dividing a Web application into three parts: the model, the view and the controller.
- The model manages the data (access to databases, files, blob storages...)
- the view is responsible for representing the data provided by the model in a certain form
- the controller manages request from users and provides a response using the model and the view
What are the advantages of this architecture?
The application respecting the MVC architecture is modular and it avoids completely change the application if the developer just needs to display data in a different form or modify data access.
After creating an ASP MVC web application with Visual Studio, you can see the presence of the Views, Controllers and Models directories.
The Views directory contains aspx, cshtml, and vbhtml files, depending on the language content.
Controllers and Models directories contain cs or vb files.
A Model or Controller are C# or VB.NET classes.
A controller contains methods ending in return View(); called controller action.
For example, if you declared a controller named CarsController containing the controller action index(), you can trigger this action by entering the following URL in the address bar of the browser: http://localhost/Cars/Index