当处理其关联的 HttpModule 时,不处理 HttpHandler

发布于 2024-07-13 13:12:08 字数 324 浏览 9 评论 0原文

在我们的 asp.net 2.0 应用程序中,我们有 HttpModule 和 HttpHandler。 它们在 web.config 中注册以处理某些文件类型的请求。 该请求是使用 MS AJAX 从客户端异步发起的。 我注意到一些奇怪的事情: HttpHandler:ProcessRequest 并未在每个 HttpModule:EndRequest 上输入,因为我对事件流程的理解,这似乎是不正确的行为: HttpModule:开始请求> HttpHandler:ProcessRequest> HttpModule:结束请求。 由于某种原因,处理程序部分有时会被跳过。 可能是什么原因造成的?

In our asp.net 2.0 application we have the an HttpModule and HttpHandler. They are registered in web.config to handle requests for certain file types.
The request is initiated asynchronously from client side using MS AJAX.
I noticed something strange:
HttpHandler:ProcessRequest is not entered on every HttpModule:EndRequest which seems like incorrect behavior since my understanding of the flow of events:
HttpModule:BeginRequest > HttpHandler:ProcessRequest > HttpModule:EndRequest. For some reason, the handler part is sometimes skipped.
What could be causing this?

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

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

发布评论

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

评论(3

落墨 2024-07-20 13:12:08

如果我理解正确的话,HttpModule 将会针对到达应用程序的每个请求执行,而 HttpHandler 只会针对注册的扩展执行。

因此,除了您向处理程序发出的请求之外,可能还会向应用程序发送其他请求。

If I understand correctly, HttpModule would get executed for every request which comes to your application, while the HttpHandler would execute only for the registered extension.

So, there could be other request to the app apart from the ones you make to your handler.

蓝梦月影 2024-07-20 13:12:08

您是否在 IIS 中设置了由 .net 处理的文件类型?

Do you have that file type set up in IIS to be processed by .net?

小忆控 2024-07-20 13:12:08

我相信对 Server.Transfer 和 Response.End 的调用可以使管道短路,您的逻辑分支是否可能这样做?

I believe that calls to Server.Transfer and Response.End can short-circuit the pipeline, is it possible a branch of your logic does this?

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