I think I understand how ASP.NET routing works, and in general how the IIS handler mappings work, but I don't know how they work together. It says that the HttpHandler is mapped during the MapRequestHandler phase in the application life cycle. And as far as I can tell, the UrlRoutingModule that implements ASP.NET routing runs at about that time as well. Both seem to examine the URL and determine the appropriate IHttpHandler to use for the request.
So which one runs first? How do they communicate to one another? Which one will take precedence is both are trying to map the same URL?
I have a feeling that setting HttpContext.Handler is involved but I don't know how.