HttpContext.Current.Session为null的问题
2012-09-07 18:44
295 查看
在写mvc的开发程序的时候
通过post请求将用户信息提交到处理页面(*.ashx),然后通过处理页面调用类库中某个类下的登录方法
之前当调用登录方法时做了判断:if (HttpContext.Current.Session != null) 这个时候Session始终的null
于是将该类实现了接口:IRequiresSessionState (using System.Web.SessionState;)
结果Session还是null。。。
接着我把处理页也继承接口:public class ActionsHander : IHttpHandler, IRequiresSessionState
问题解决了!!!
通过post请求将用户信息提交到处理页面(*.ashx),然后通过处理页面调用类库中某个类下的登录方法
之前当调用登录方法时做了判断:if (HttpContext.Current.Session != null) 这个时候Session始终的null
于是将该类实现了接口:IRequiresSessionState (using System.Web.SessionState;)
结果Session还是null。。。
接着我把处理页也继承接口:public class ActionsHander : IHttpHandler, IRequiresSessionState
问题解决了!!!
相关文章推荐
- HttpContext.Current.Session为null的问题
- 问题:HttpContext.Current.Session;结果:Session与HttpContext.Current.Session到底有什么区别呢?
- System.Web.HttpContext.Current.Session为NULL值的问题?
- System.Web.HttpContext.Current.Session为NULL值的问题?
- System.Web.HttpContext.Current.Session NullReference错误
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- System.Web.HttpContext.Current.Session为NULL值的问题?
- 一般处理程序中 httpContext.current.session为null的解决办法
- httpContext.Current.Session[值] 取值的问题
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- 在IIS7下使用HttpModule的过程中遇到很诡异的问题,HttpContext.Current.User为NULL
- System.Web.HttpContext.Current.Session为NULL解决方法
- HttpContext.Current.Session.SessionID相关问题及备忘
- abp项目中无法使用HttpContext.Current.Session[""]的问题
- System.Web.HttpContext.Current.Session为NULL值的问题?
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- HttpContext.Current.Session为null
- System.Web.HttpContext.Current.Session为NULL值的问题?