首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

webservice和页面之间的session有关问题

2012-03-14 
webservice和页面之间的session问题我有一个网站。里面有页面和webservice而且在方法前加了sessiontrueC#

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)]

热点排行