Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

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

like image 790
Eric Yin Avatar asked Jan 26 '12 10:01

Eric Yin


People also ask

What is routes IgnoreRoute?

IgnoreRoute(RouteCollection, String) Ignores the specified URL route for the given list of available routes. IgnoreRoute(RouteCollection, String, Object) Ignores the specified URL route for the given list of the available routes and a list of constraints.

What is routes MapRoute in MVC?

Routing plays important role in the MVC framework. Routing maps URL to physical file or class (controller class in MVC). Route contains URL pattern and handler information. URL pattern starts after the domain name.


1 Answers

.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.

like image 94
Roy Dictus Avatar answered Oct 12 '22 21:10

Roy Dictus