Page lifecycle of an ASP.NET MVC

What is the page lifecycle of an ASP.NET MVC?



The page lifecycle of ASP.NET MVC is having the following process and it is as follows:

-App initialization: in this the initiation of the application takes place that allow the application to interact the server and start to run the components.

-Routing: in this the messages are routed to the server for making the delivery of the request easier.

-Instantiate and execute controller: in this way the controller handles the request and passes it on to display the output or replies to the request.

-Locate and invoke controller action: The actions allow the controller to be located correctly and it invokes the correct action that has to be taken on the applications.

-Instantiate and render view: this helps in view the result of the application that is being built.
Post your comment

    Discussion

  • Can you describe ASP.NET MVC Request Life Cycle? -ASP.NET MVC Request Life Cycle (07/15/12)
  • Following are the steps that are executed in ASP.NET MVC Request Life Cycle.

    1. Application first receives the request and looks up Route object in RouteTable collection. Then the RouteData object is created.

    2. Then RequestContext instance is created.

    3. MvcHandler and pass RequestContext to handler is created.

    4. Then IControllerFactory from RequestContext is identified.

    5. Then the object of class that implements ControllerBase is created.

    6. MyController.Execute method is called.

    7. Then ControllerActionInvoker finds the action to invoke on the controller and executes that action on the controller and by calling the model associated view returns.