Ajax.Net:How to use Session and Cookie in AjaxMethod?
[作者]:菩提树下的杨过 [来源]:互联网 [收录时间]:2007-7-30 21:50:45

  Resolution:
Add a argument of AjaxPro.HttpSessionStateRequirement enum in your AjaxPro.AjaxMethodAttribute.
Here is a example:

[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]


Now u can access ur Session value like this: this.Session["0"].ToString().
So easy,right?


Another question: How to use Cookie in AjaxMethod?

The answer is u can't access cookie by the ref of "this".
You should use HttpContext.Current Object.Like this: HttpContext.Current.Request.Cookies[Name].Value.




For more information about SessionStat in Ajax.Net,See AjaxGuide.doc.