public class CustomRoutingHandler : MvcRouteHandler
{
protected override IHttpHandler GetHttpHandler(RequestContext requestContext)
{
requestContext.HttpContext.Session is NULL;
//Is there any way to access Session from there ?
return FindHttpHandler(requestContext);
// In created handler Session is not null
}
}
答案 0 :(得分:0)
也许您遇到此问题:请参阅http://www.heartysoft.com/aspnet-routing-iis7-remember-modules。
解决方案是再次删除并添加会话状态模块。
另请参阅相关的SO问题:HttpContext.Current.Session is null when routing requests