【发布时间】:2012-10-17 18:39:05
【问题描述】:
由于我的疏忽(对于 AppState 和 Session 变量仍然是新手),我必须将我的所有 AppStates 更改为 Session 变量。 WebMatrix 的替换使这部分变得简单,但是我现在在下面两行代码的第一行中遇到了这个错误:
Session["gActionMessage"] = "";
Session["gActionMessageDisplayed"] = "not";
错误:
Compiler Error Message: CS0103: The name 'Session' does not exist in the current context
如果重要,这些代码行在我的 _AppStart.cshtml 文件中。
有什么建议吗?是不是语法错了?
【问题讨论】:
标签: c# session-variables webmatrix