如何在AjaxPro.net的AjaxMethod中使用session和cookie

解决方案:添加一个AjaxPro.HttpSessionStateRequirement 枚举的值到你的AjaxPro.AjaxMethodAttribute中.例如: [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]    现在你就可以像下面这样存取Session的值了: this.Session["0"].ToString().另外一个问题:如何在AjaxMethod中使用Cookie? 答案是不能使用"this"的引用存取cookie ,你必须使用HttpContext.Current例如: HttpContext.Current.Request.Cookies[Name].Value.关于AjaxPro.Net的更多信息,请看 AjaxGuide.doc. 
posted on 2007-05-23 08:16  上校  阅读(522)  评论(0编辑  收藏  举报