Answer: Yes we can use session variables in class. This can be done using this way
First of all we need to import the name space
Use HttpContext.Current.Session
In C#.Net
HttpContext.Current.Session["Value1"] = "1";
In VB.Net
HttpContext.Current.Session("Value1") = "1"
Asked In: Many Interviews |
Alert Moderator