解决办法

1.添加命名空间

using System.web.SessionState;

2.添加继承IRequiresSessionState

可以使用context.Session获取值啦

就这么简单

相关文章: