什么是 routes.IgnoreRoute("{resource}.axd/{*pathInfo}") [英] What is routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

查看:22
本文介绍了什么是 routes.IgnoreRoute("{resource}.axd/{*pathInfo}")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

我在我的项目中找不到任何 .axd 文件,我可以删除此路由规则吗?

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

推荐答案

.axd 文件在物理上不存在.ASP.NET 在内部使用带有 .axd 扩展名(ScriptResource.axd 和 WebResource.axd)的 URL,它们由 HttpHandler 处理.

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

因此,您应该保留此规则,以防止 ASP.NET MVC 尝试处理请求,而不是让专用的 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.

这篇关于什么是 routes.IgnoreRoute("{resource}.axd/{*pathInfo}")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆