转自http://www.cnblogs.com/singleblue/default.html?page=2
使用AjaxPro时遇到一个问题:
利用AjaxPro调用后台代码,出现错误,由于后台代码与Session有交互
错误信息为:
"只有在配置文件或Page指令中将enableSessionState设置为true时,才能使用会话状态.还请确保在应用程序配置的<configuration>/<system.web>/<httpModules>节中包括System.Web.SessionStateMod或自定义会话状态模块"
解决方法如下,在Web.config中允许Session,并在ajaxpro方法前加
[AjaxMethod(HttpSessionStateRequirement.ReadWrite)] // 读写Session:
或
[AjaxMethod(HttpSessionStateRequirement.Read)] // 只读Session: