Home > DeveloperSection > Forums > How to access session variable in the class?
Pooja Malohtra
Pooja Malohtra

Total Post:47

Points:331
Posted on    October-15-2010 7:48 AM

 ASP.Net ASP.Net 
Ratings:


 3 Reply(s)
 1100  View(s)
Rate this:
Hi!
How to access session variable in the class?
Thank you.
 


Uttam Misra

Total Post:124

Points:888
Posted on    October-15-2010 8:16 AM

String strSessionName="";

strSessionName= Convert.ToString(httpcontext.current.session["SessionName"]);

Modified On Oct-15-2010 08:19:14 AM

Uttam Misra

Total Post:124

Points:888
Posted on    October-15-2010 8:17 AM

You can simply use: System.Web.HttpContext.Current.Session 



Pooja Malohtra
Pooja Malohtra

Total Post:47

Points:331
Posted on    October-15-2010 8:23 AM



Don't want to miss updates? Please click the below button!

Follow MindStick