Dinesh Satpute

Dinesh Satpute

  • NA
  • 2
  • 16.7k

how to use session variable in class files asp.net 4.0 C#

Feb 17 2014 2:53 AM
i have created on web application in Asp.net 4.0 using C#.
i have implemented session in asp pages but i want to access same session data in my class files.
i have searched regarding this, and then i used
   HttpContext.Current.Session["something"] 
but it is always throwing NullException.
 
I am calling this method from page load of aspx page.
 
Thanks in advance....

Answers (2)