Home > Articles > .Net Framework Articles > MVC Page life cycle

MVC Page life cycle

by SARNAM SINGH   on Jun 27, 2016   Category: .Net Framework  | Level: Intermediate  |  Views: 333    |  Points: 100   
Like this article? Bookmark and Share:
MVC Page life cycle

MVC Page life cycle:

1. Receive first request for the application: When request received first time, UrlRouting module add routes to route table and it can be done by calling MapRoute method in application_start event of global.asax file, so this route table will have all routes available in the application.

2. Perform Routing: Url Routing moudle scan the route table and find the first matching route. Once it find the route stop the route table scanning and prepare RouteData object based on the incoming url that may consist of controller name, action method name and optionally some parameters in the form of query string or method arguments, which it then uses to instantiate RequestContext object.

3. Create MVC handler: MVCRouteHandler create the instance of IHttpHandler, which is MVCHandler (for MVC) and assign the RequestContext object to it.

4. Create Controller: MVC Handler uses the RequestContext object to identify the controller and create the instance of IControllerFactory object.

5. Execute Controller: MVC handler calls the controller's execute method.

6. Invoke Action: ControllerActionInvoker instance associated with the current Controller determine which action method to call and invoke the action method.

7. Execute Result: Action method receive the user provided input, perform business logic and return the result to corresponding view which is then rendered via browser.

 



Like this article? Bookmark and Share:

Most viewed Articles

User Comments


No response found, be the first to review this article.

Submit feedback about this article

Please sign in to post feedback

Latest Posts