ASP. Routing Debugger Routing Debugging tool

Source: Internet
Author: User

Website address: http://blog.csdn.net/sgear/article/details/6789882

Simply download the following zip file and place the assembly inside of it into your Bin folder. Then on your Global.asax.cs file add one line to the Application_Start method (in bold).

protected void Application_Start(object sender, EventArgs e){ RegisterRoutes(RouteTable.Routes); RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);}

Test Routing

Because a URL matches more than one routing rule, you often end up with a problem where the rules are written incorrectly or in the wrong order. So we want to see the results of the URL matching routing.

The simplest way to do this is to use the Routedebug helper class. This class needs to download the DLL component separately, and I've put this component's download on the blog park:

After decompression is a DLL file that adds this DLL file to the project and adds references.

The way to use it is simple, just add a word to the Application_Start method:


For example, here is the code in my example:


Now that you access any URL, the Routedebug page will appear, as follows:

Not only do you have all of your routing rules, but they also show whether they match. and are listed in order. There is also a list of identified parameters.

When you don't want to test the routing rule, comment out the paragraph and jump to the View object.

ASP. Routing Debugger Routing Debugging tool

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.