This was going to be a full on post, but it appears the next preview of the MVC bits will do a good chunk of what I was writing up. So for posterity, here's the general routing flow in the current ASP.NET MVC release:
- Define your routes in RouteTable
- PostResolveRequestCache event in the UrlRoutingModule passes every request to the RoutingTable to determine the relevant route
- If a route matches, an IRouteHandler is created
- The IRouteHandler gets the appropriate IHttpHandler for the specified route, passing along a RequestContext object (which contains RouteData)
- Default IRouteHandler uses ControllerName + Action format and reflection
- IHttpHandler and original path are stored in an internal RequestData object, which is appended to the context.Items collection
- Path is rewritten to ~/Mvc.axd
- PostMapRequestHandler event in the UrlRoutingModule grabs the RequestData from the Items collection, rewrites the path back to the original path and sets the IHttpHandler from step 4 to the context.Handler property
- Profit!