ASP.NET MVC registration routing process source code analysis

Four objects of the routing module:

  • Route(Routing rule object): Contains routing rules and routing Handler(the responsibility of the routing handler is to obtain the final processing Http request PrHandler)
  • RouteData(Routing data)
  • RouteCollection(Collection object of routing rules)
  • RouteTable(Routing table)

Between the seventh and eighth events: first determine whether there is a specific PrHandlerprocessing of this Http request specified in the context . If it is not specified, then create a page or a general processing program based on the URL address.

In MVC: by URLRoutingModelregistering the seventh event, that is, when the pipeline executes to the seventh event, URLRoutingModelthe Init()method HttpModuleinside is executed , and the time response method inside is executed . In this event

The response method is to redirect the current context to an existing one PrHandler.
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/WuLex/article/details/112114030