非 aspx 页面不会触发 IHttpModule 错误事件

发布于 2024-09-30 15:31:49 字数 294 浏览 1 评论 0原文

我创建了一个模块并以 iis7 集成模式托管它。

对于任何 aspx 和 html/php/任何扩展名的请求,BeginRequest 事件始终会被触发。

但Error事件仅针对aspx扩展触发,但在cassini中有效。

尝试过:

它已在 system.webserver 以及 system.web 中注册。

任何想法为什么会发生这种行为?

I've created a module and hosting it in iis7 integrated mode.

The BeginRequest event always get triggered for any request both aspx and html/php/whatever extension.

But the Error event only triggers for aspx extensions, but it works in cassini.

Tried: <modules runAllManagedModulesForAllRequests="true">

It's registered in system.webserver aswell as system.web.

Any ideas why this behavior happens?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北斗星光 2024-10-07 15:31:49

唉,你什么也得不到; IIS 只会引发托管处理程序的错误事件。

这里只是集思广益:如果您想从 PhP 捕获错误结果,您可以尝试处理 EndRequest 或 PostRequestHandlerExecute 并检查 HTTP 状态代码是否有 500 之类的事情。这与处理错误事件并不完全相同,但它可能对您有用。

Alas, you won't get any; IIS will only raise error events for managed handlers.

Just brainstorming here: If you'd like to capture an error result from PhP, you might try handling EndRequest or PostRequestHandlerExecute and inspecting the HTTP status code for a 500, that sort of thing. That's not exactly the same as handling an error event but it might work for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文