Getting Syntax Error in ASP.NET Routing Due to WebResource.axd
If you implement routing in an ASP.NET 4.0 web application and use the validation controls in it, it is good to keep in mind that you need to add an exception for the .axd files in your Global.asax file. Otherwise, you will keep getting a syntax error because the routing picks up the .axd files and not properly loads the JavaScript files needed for the validation controls.


If same issue occurs in an ASP.NET 3.5 SP1 application, you can use the StopRoutingHandler class which implements the IRouteHandler interface.
Advertisement
Thanks a lot!
Behzad
November 23, 2010 at 5:53 AM
I had exactly the same issue, and Google took me this way. Thank you for the sample code.
Garcia
March 16, 2011 at 8:24 AM
Added to my Bookmarks.
Pharvazi Patel
May 18, 2011 at 9:26 PM
Saved my day, thank you.
Jonathan S.
June 12, 2011 at 1:55 PM