日期:2014-05-18  浏览次数:20646 次

webservice和页面之间的session问题
我有一个网站。里面有页面和webservice而且在方法前加了session=true
C# code

 [WebMethod(true)]   
    public string GetMenuList()
    {
        int userId = 17;// int.Parse(Session["UserID"].ToString());  //以后从session中读取
        string strSql = "";
}



当页面用js(jquery)方法访问webservice的时候,页面的session和webservice是不一致的


我查了点资料说要指定相同的CookieContainer。请问这个cookiecontainer该怎么设置
我在this里点不出CookieContainer。

------解决方案--------------------
[WebMethod(EnableSession = true)]