ASP.NET MVC lifecycle

February 23, 2012 at 4:47 PMMadestro

I was working on something and needed to refer to the ASP.NET MVC lifecycle so I went out there and found the following information which I have compiled for your benefit:

Overview of the Lifecycle Steps

There are five main steps that happen when you make a request from an ASP.NET MVC website:

1. The RouteTable is Created

This first step happens only once when an ASP.NET application first starts. The RouteTable maps URLs to handlers.

2. The UrlRoutingModule Intercepts the Request

This second step happens whenever you make a request. The UrlRoutingModule intercepts every request and creates and executes the right handler.

3. The MvcHandler Executes

The MvcHandler creates a controller, passes the controller a ControllerContext, and executes the controller.

4. The Controller Executes

The controller determines which controller method to execute, builds a list of parameters, and executes the method.

5. The RenderView Method is Called

Typically, a controller method calls RenderView() to render content back to the browser. The Controller.RenderView() method delegates its work to a particular ViewEngine

Source: http://stackoverflow.com/questions/2355139/what-is-the-lifetime-of-a-asp-net-mvc-controller

I also found a chart by Steve Sanderson you can print and keep around your desk:

http://blog.stevensanderson.com/2009/10/08/aspnet-mvc-learning-resource-request-handling-pipeline-poster/

Posted in: ASP.NET MVC

Tags:

Comments (3) -

Custom Printed Box
United States Custom Printed Box says:

Saved as a favorite, I love your blog!|

Reply

Brett Rossi
United States Brett Rossi says:

Have any arguments about me adding this on twitter?

Reply

Juan Romero
United States Juan Romero says:

Hi there. Feel free to publish this wherever you want.

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading