原文连接


在webService里面Session默认是不可用的,必须得开启Session才能使用,如
[WebMethod(EnableSession = true)]
public string Login(string name)
{
    Context.Session["name"] = name;
    return name;
} 
需要在当前方法上启用Session [WebMethod(EnableSession = true)]







本文转载:CSDN博客