What is routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

Eric Yin picture Eric Yin · Jan 26, 2012 · Viewed 62.1k times · Source

What is routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

I cannot find any .axd file in my project, can I remove this route rule?

Answer

Roy Dictus picture Roy Dictus · Jan 26, 2012

.axd files don't exist physically. ASP.NET uses URLs with .axd extensions (ScriptResource.axd and WebResource.axd) internally, and they are handled by an HttpHandler.

Therefore, you should keep this rule, to prevent ASP.NET MVC from trying to handle the request instead of letting the dedicated HttpHandler do it.