What is routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
I cannot find any .axd file in my project, can I remove this route rule?
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.
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.
.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With