Http 模块 - 检测 Response.End 是否被调用

发布于 2024-10-03 05:18:03 字数 241 浏览 0 评论 0原文

我有一个 http 模块,用于测试 BeginRequest 方法中的某些值。失败时,我正在编写日志并调用 Response.End。

现在,我还对 EndRequest 中的响应执行一些操作。如果 BeginRequest 测试失败,我想绕过这些项目。不幸的是,Response.End 并没有完全终止管道。

那么,有什么方法可以检测在 EndRequest 事件中调用了 response.end 或者是否有其他方法可以实现此目的?

I have an http module that tests for certain values in the BeginRequest method. On failure, I am writing a log and calling Response.End.

Now, I'm also doing a few things with the response in the EndRequest. I'd like to bypass those items if the BeginRequest tests failed. Unfortunately, Response.End doesn't exactly kill the pipeline.

So, is there any way to detect that response.end was called in the EndRequest event OR is there some other way I can accomplish this?

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

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

发布评论

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

评论(1

醉态萌生 2024-10-10 05:18:03

如果您只想知道是否在 BeginRequest 中调用了 Response.End,而不是将布尔值存储在 HttpContext.Current.Items 集合中并在 EndRequest 中读出

if you only want to know if you called Response.End in your BeginRequest than store a boolean in the HttpContext.Current.Items collection and read that out in the EndRequest

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