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

前端 未结 5 1866
一整个雨季
一整个雨季 2020-11-29 00:17

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

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

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 01:05

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

提交回复
热议问题