Use Asp.net route to implement URL resolution

Source: Internet
Author: User

ASP. NET routes are different from URL rewriting. URL rewriting processes incoming requests by actually changing the URL before sending the request to the webpage. For example, an application that uses URL rewritingProgramThe URL may be/Products/widgets/Change/Products. aspx? Id = 4. In addition, there is usually no corresponding API for URL rewriting to create a pattern-based URL. In URL rewriting, if the URL mode is changed, you must manually update all hyperlinks containing the original URL.

due to ASP.. Net routes can extract values from URLs, so the URL is not changed when processing incoming requests. if you must create a URL, pass the parameter value to the method that generates the URL for you. to change the URL mode, change the mode in a certain location. All links created in the application based on this mode will automatically use the new mode.

 

With this, we can achieve a lot of results on the web site.

For more information, see

 

Http://msdn.microsoft.com/zh-cn/library/dd329551.aspx

 

 

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.