我的IHttpModule无法访问HttpContext Current [英] My IHttpModule Can't access HttpContext Current

查看:86
本文介绍了我的IHttpModule无法访问HttpContext Current的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在所以我必须在这里问一下,说明:

so I have to ask here, Description:

场景

           平台:Visual Studio 2015,

             platform: Visual studio 2015,

              framework:.net框架4.5

             framework:.net framework 4.5

              project:使用HttpTaskAsyncHandler的ashx,并插入IHttpModule

             project : ashx with HttpTaskAsyncHandler, and plug IHttpModule

问题:

               触发OnPreSendRequestHeaders时,HttpContext.Current为null.似乎响应线程上下文已更改.

               when the OnPreSendRequestHeaders is triggered, the HttpContext.Current is null. it's seems like the response thread context has been changed.

请帮助我,谢谢.

推荐答案

您好CrazyOldPotato,

Hi CrazyOldPotato,

谢谢您在这里发布.

我们不是ASP.NET的专家,根据我的搜索,您可以检查以下链接.

We are not the experts for ASP.NET, based on my search, you could check the following link.

https://stackoverflow.com/questions/276355/can -i-access-session-state-from-an-httpmodule

https://stackoverflow.com/questions/1572283/httpcontext-current-session-is-null-in-a-module-i-dont-have-access-to

我希望这会有所帮助.

最好的问候,

温迪


这篇关于我的IHttpModule无法访问HttpContext Current的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆