【发布时间】:2011-07-05 04:29:03
【问题描述】:
我使用这个从另一个控制器调用了一个方法
AnotherController oriCon = new AnotherController();
oriCon.ApproveOperation(formCollection, ref responseMsg);
现在,在 ApproveOperation 方法中,我这样调用会话变量
int activeUser = (int)HttpContext.Session["user"];
但它给了我错误;空值
我之前在forums.asp.net问过,有人告诉我用
HttpContext.Current.Session
但我不能使用它,我的 HttpContext 中没有 Current 属性。我没有 Current 属性,因为我使用的是 MVC 1.0 框架 3.5。也许是那个用 MVC 2.0 框架 4.0 回答我的人?
谁能告诉我这个?
【问题讨论】:
标签: asp.net-mvc session controller httpcontext