会话状态在此上下文中不可用——解决方法

问题原因分析:项目中包含各种类型的文件 访问.html的时候无法获取Session

解决办法:在上图中出现错误之前添加判断 当访问的是.aspx类型的文件时在访问Session

if (!application.Context.Handler.ToString().EndsWith("aspx")) {

return;

相关文章:

  • 2021-09-29
  • 2022-01-18
  • 2021-07-24
  • 2022-01-20
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2021-11-29
  • 2021-05-26
  • 2021-08-16
相关资源
相似解决方案