ArticleDirectory
- Iroutehandler Interface
- Ihttphandler Interface
Route parsing analysis mainly describes the main process of Route parsing, that is, the route parsing pipeline, which implements the urlroutingmodule class, iroutehandler interface, and ihttphandler interface for Route parsing.
Urlroutingmodule class is processed in ASP. net3.5 MVC websiteProgramEvery time you type a URL in your browser, a user request is sent. The urlroutingmodule Class responds to the user's request and processes the user's request;
Search the routcollection set in the routtable class to obtain the matched route;
Get the instantiation object of the route class through route parsing;
Distribute users' requests to the routing handler that implements the iroutehandler interface, and enter the requestcontext parameter;
Finally, the mvchandler processing program implementing the ihttphandler interface is distributed again, and the relevant controller is located to execute the relevant action methods in the Controller and implement the response output.
Urlroutingmodule class
The urlroutingmodule class mainly implements route processing, such as retrieval, matching, and other parsing processes.
Configuration in Web. config for use:
<Httpmodules><Add Name="Urlroutingmodule" Type="System. Web. Routing. urlroutingmodule, system. Web. Routing, version = 3.5.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35" /></Httpmodules>
Iroutehandler Interface
The urlroutingmodule class distributes user requests to the mvcroutehandler class that implements the iroutehandler interface after obtaining the URL routing, and passes in the requestcontext parameter.
Ihttphandler Interface