MVC
Model-View-Controller
Last updated
Model-View-Controller
Last updated
MVC is a design pattern used to decouple user-interface (view), data (model), and application logic (controller). This pattern helps to achieve separation of concerns.
Responsible for bringing data to View.
Data Access Layer
Validation
Data Annotations
Client Validations
Remote Validations
Responsible for rendering UI.
Types
WebForm View (.aspx, .ascx, .master)
Razor View (.cshtml, .vbhtml)
@model - defines the type of data coming into the view
@Model - accesses the model data passed into the view
Responsible for handling every user requests.
Responsible for building the model and selecting a view to render.
responsible for sending the data to the view.
Methods that return IActionResult
are called Action methods and provide responses usable by browsers.