Global.asax 事件在带有 .net 4 路由的 IIS 7 集成模式下未触发
我刚刚切换到使用 Server 2008/IIS 7。我正在集成模式下运行我的应用程序。我正在使用 .Net 4.0 路由功能并使用无扩展名的 url。
我的问题是 global.asax 文件中 BeginRequest 之后的事件不会触发。
如果我使用 .aspx 扩展名访问我的页面,则事件会触发,但如果页面没有扩展名,则事件不会触发。
有谁知道我必须做什么才能让 Application_AcquireRequestState 事件在 IIS 7 中针对路由的、无扩展名的 URL 触发?
I just switched over to using Server 2008/IIS 7. I am running my application in integrated mode. I am using the .Net 4.0 routing feature and using extension-less urls.
My problem is that the events in the global.asax file that are after the BeginRequest don't fire.
The events fire if I hit my page using an .aspx extension but not when it doesn't have an extension.
Does anyone know what I have to do to get the Application_AcquireRequestState event to fire for routed, extension-less urls in IIS 7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 Global.asax 中的事件仅针对由标准
HttpHandler
(从Page
类派生的对象)处理的请求触发。要接收每个请求的事件,您应该创建并注册一个
HttpModule
。I believe the events in Global.asax only fire for requests that are processed by the standard
HttpHandler
(objects derived from thePage
class).To receive events for every request, you should create and register an
HttpModule
.