Session is null in ashx

 
If the HttpContext.Current.Session is null in your .ashx handler, add System.Web.SessionState.IReadOnlySessionState to your class declaration, like this:
public class MyHandler : IHttpHandler, System.Web.SessionState.IReadOnlySessionState
Also, if you need to write to Session[], you can use IRequresSessionState instead of IReadOnlySessionState.
see also:
http://forums.asp.net/t/1773026.aspx/1
http://stackoverflow.com/questions/7705802/httpcontext-current-session-is-null-in-mvc-3-appplication

相关文章:

  • 2022-03-09
  • 2021-06-07
  • 2022-02-16
  • 2022-03-09
  • 2021-10-27
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2021-08-01
  • 2021-09-18
  • 2021-12-18
  • 2022-03-10
  • 2021-12-28
  • 2021-08-17
相关资源
相似解决方案