ASP.NET MVC Request Flow

Writing

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!

Loved the article? Hated it? Didn’t even read it?

We’d love to hear from you.

Reach Out

Comments (8)

  1. 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?

  2. @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.

    1. 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

Leave a Reply

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

More Insights

View All