最近有朋友使用ashx文件来做一些轻量级的ajax应用,发现在ashx文件中无法使用Session,直接获取context.Session只能取得null,非常奇怪。后发现要使用Session,必须让这个General Handler类实现IRequiresSessionState接口,然后再用context.Session或HttpContext.Current.Session就能获取Session了。MSDN称这是个标记接口,没有任何成员。

相关文章:

  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-12-14
  • 2022-12-23
  • 2022-01-06
  • 2021-10-10
猜你喜欢
  • 2021-09-17
  • 2022-12-23
  • 2022-02-23
  • 2021-10-26
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案