谁能给我一个示例或链接到在 asp.net mvc 中使用 session 的示例或链接?
最佳答案
与 WebForms 中相同:
使用 HttpContext.Current.Session 对象。
HttpContext.Current.Session["UserName"] = "Jon";
string userName = HttpContext.Current.Session["UserName"];
关于asp.net mvc session 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1199599/