ASP.NET MVC Request Flow

I gave a presentation Thursday at the Richmond Meet and Code. This presentation covered Microsoft’s new web app framework “ASP.NET MVC”. My presentation was actually quite short, but one of the things I wanted to show was the flow of a request into System.Web.Routing and through System.Web.MVC. I looked around on the web and I could not find one, so I ended up creating one. I decided to go ahead and reformat it to fit on the blog.

This graphic shows the user sending in a url, and a Route being matched inside of the RouteCollection. I glossed over this part a bit, but what I wanted to highlight was the Url and RouteHandler that the Route class held. This is the way in which the request is passed from System.Web.Routing over to System.Web.Mvc. Once it gets into System.Web.Mvc I tried to show all of the major classes involved and the method that is invoked on each.

image

I hope that this helps someone out!

Be Sociable, Share!

7 comments

  1. Great talk the other night. Definitely appreciate you putting on the event.

  2. Just came across this blog and the request flow diagram is just what was required for me…

    Thanks.
    Rajesh Pillai

  3. @Chris Thanks! I thought the talk went really well.

    @Rajesh Glad it helps out.

  4. This is helpful, but I’m still a little fuzzy on what happens to my ActionResult – how it magically picks a view and renders it. I’d assume Execute() does something with it, but maybe you could add the return path after InvokeAction to the diagram?

  5. @Daniel When you just return "View()" from an action it is going to pick a View that has the same name as the action being invoked and within the proper folder for the controller you are in. But you can also specify a view name if you want.

  6. Can I steal that graphic and share with others? Will NOT be posted on any public website.

  7. Justin Etheredge

    Yeah, feel free to use it wherever you want, just provide attribution. Be aware that the image might be a little dated now, that was done based on MVC1.

Leave a comment