Personal Blog of Mustafa Basgun

Getting Syntax Error in ASP.NET Routing Due to WebResource.axd

with 6 comments

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.


Written by Mustafa Basgun

October 25, 2010 at 9:51 PM

Posted in AJAX, ASP.NET, C#, Web Development

Tagged with ,

6 Responses

Subscribe to comments with RSS.

  1. Thanks a lot!


    November 23, 2010 at 5:53 AM

  2. I had exactly the same issue, and Google took me this way. Thank you for the sample code.


    March 16, 2011 at 8:24 AM

  3. Added to my Bookmarks.

    Pharvazi Patel

    May 18, 2011 at 9:26 PM

  4. Saved my day, thank you.

    Jonathan S.

    June 12, 2011 at 1:55 PM

  5. Routes.Ignore line did the trick. I am amazed that this is not more known. Thanks!


    July 24, 2013 at 3:52 PM

  6. Thanks! 3 years of problems has been solved with solution!


    September 23, 2013 at 3:04 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: