Understanding ASP. NET 3.5 MVC routing Analysis

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.