一个类中的Asp.net会话属性问题

时间:2017-03-12 13:33:21

标签: asp.net session

我在课堂上检查课程。但Session属性为null我的意思是不是变量会话属性。

通常我们可以这样检查。会话它是否为空

if(HttpContext.Current.Session["member_login"] !=null)

**HttpContext.Current.Session**代码行的这一部分为空,没有字符串变量。是什么问题我搜索了堆栈溢出但我找不到像这个问题

Webservices导致了这个问题但是当我们通过web方法添加这个属性时我们可以解决它

[WebMethod (EnableSession = true)]

是这样的问题吗?

enter image description here

enter image description here

检查第二个图像会话属性是否为空

1 个答案:

答案 0 :(得分:0)