Hi, can someone give me an example or link to one of using a session in asp.net mvc?
+5
A:
The same as in WebForms:
Use the HttpContext.Current.Session object.
HttpContext.Current.Session["UserName"] = "Jon";
string userName = HttpContext.Current.Session["UserName"];
User
2009-07-29 11:35:58
You posted 10 seconds earlier! ^^
Arnis L.
2009-07-29 11:37:12
Trimack
2009-07-29 11:39:53
There is one small section on sessions in Professional ASP.NET MVC 1.0 book (written by the authors of the framework) and they make use of standard ASP.NET Sessions as shown above.
Ray Vernagus
2009-07-29 11:45:12
Thats enough for me then. Thanks.
Trimack
2009-07-29 11:48:42