CONTROLLER
Controller is the first step of MVC which can
be explained very well with the following points.
- A controller is responsible for
controlling the way that a user interacts with an MVC
application.
-
A controller determines what response
to send back to a user when a user makes a browser request.
VIEW
The view can be defined as the following:
- A view contains the HTML markup and
content that is sent to the browser.
- A view is the equivalent of a page when
working with an ASP.NET MVC application.
- We must create views in the right
location. The HomeController.Index() action returns a view
located at the following path:
\Views\Home\Index.aspx
- The HomeController.About() action
returns a view located at the following path:
\Views\Home\About.aspx
MODEL
The Model can be defined as.
- An MVC model contains all of your
application logic that is not contained in a view or a
controller
- The model will contain all of our
application business logic and database access logic and
other logic
- DataLayer kind of classes, Types
for data should be created in MVC model.
Conclusion
In the next articles of this series, we will
see most of the differences and advantages of using MVC.