In previous articles we discussed about the MVC pattern, sample MVC application and its application structure. Now let discuss more about one of the core components of MVC pattern.

Controller is responsible for many operations in asp.net application and major items are listed below
- It is responsible responding to user input such as button/hyperlink click, mouse/keyboard operation etc,
- It is responsible to making changes to the model in response to user input.
- It is responsible to load the relevant view to the user based on the user input
Controller Class
You can create controller class by following the below pattern
- Any class need to act as a Controller should be inherited from the Controller class
- All the controller class should be placed inside the \Controllers folder
- Controller class name should be prefixed with Controller e.g: HomeController, ProductController, etc Minimum controller class should have one action method
Example

ASP.Net Web Form page request cycle
Below diagram explains about the user request is processed based on web form

ASP.Net MVC page request cycle
Below diagram explains about the user request is processed based on MVC
