This post was migrated from Justin’s personal blog, 'Codethinked.com.' Views, opinions, and colorful expressions should be taken in context, and do not necessarily represent those of Simple Thread (and were written under the influence of dangerous levels of caffeination).

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!

8 Comments

Daniel

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?

Reply
Justin Etheredge

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

Reply
Ryan

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

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

Reply
Priya

Hi, I am unable to see the image. Can you please post it again??
Thanks Priya.

Reply

Leave a Reply

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