Application_BeginRequest 调用图像
我看过一些关于 Application_BeginRequest
的帖子,但似乎没有一个有我的问题。
我的 Application_BeginRequest
正在为我网站中的每个图像调用。
StaticFileHandler
使用 * 作为路径启用,但它位于列表的末尾。
这是正常行为吗?或者我应该在列表顶部添加 .gif
、.jpg
等?
这是在我的 IIS7.5 Win7 开发服务器上。尚未在生产服务器上检查。
更新: 设置 runAllManagedModulesForAllRequests="false"
会有帮助。但是 ASP.NET URL 映射不再起作用。我尝试直接为图像禁用它,但没有效果?
<location path="Resources">
<system.webServer>
<modules runAllManagedModulesForAllRequests="false">
</modules>
</system.webServer>
<location>
I've seen a few posts about Application_BeginRequest
, but non seems to have my problem.
My Application_BeginRequest
is being called for every image in my website.
The StaticFileHandler
is enabled with * as the Path, but it's at the end of the list.
Is this the normal behaviour? Or should I add .gif
, .jpg
and so on on top of the list?
This is on my IIS7.5 Win7 Development Server. Didn't check it on the production server yet.
Update:
Setting runAllManagedModulesForAllRequests="false"
would help. But then the ASP.NET URL Mapping does not work anymore. I tried disable it just for the image directly, but that had no effect?
<location path="Resources">
<system.webServer>
<modules runAllManagedModulesForAllRequests="false">
</modules>
</system.webServer>
<location>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保该值在您的 web.config 中为 false。
如果您正在运行 MVC 应用程序,我建议您查看此 帖子
make sure this value is false in your web.config.
if you are running an MVC app I'd suggest looking at this post