62,050
社区成员
发帖
与我相关
我的任务
分享
<httpModules>
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
<add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</httpModules>
一些非aspx的请求--如一般处理程序ashx需要自己去注册一下Session,楼上几位贴的IRequiresSessionState接口就是,这是一个标记接口,没有任何方法,但注明后就可以使用Session了。
同理,你的ajax请求也需要手动注明下:
AjaxPro.HttpSessionStateRequirement.Read
AjaxPro.HttpSessionStateRequirement.ReadWrite
eg:
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
public string Fun()
{
return "";
}