Page LifeCycle of ASP.Net MVC

Fill Route
-> MVC requests are mapped to route tables which in turn specify which controller and action to be invoked. So if the request is the first request the thing is to fill the rout table with route collection. The filling of the route table happens in the global.asx  file.

Fetch Route
-> Depending on the URL sent “UrlRoutingModule” searches the route table to create “RouteData” object which has the details of which controller and action to invoke.

Request Context Created
-> The “RouteData” object is used to create the “RequestContext” object

Controller instance created
-> This request object is sent to “MvcHandler” instance to create the controller class instance. Once the controller class object is created it calls the “Execute” method of the controller class.

Execute Action
-> The “ControllerActionInvoker” determines which action to execute and executes the action.

Result sent
-> The action method executes and creates the type of result which can be a view result , file result , JSON result etc.

Leave a Reply

Your email address will not be published. Required fields are marked *