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