I am developing asp.net web application in which i am using Session
to store user related data.Though i am storing data in session object when i am trying to retrieve it gives me error :
Object reference not set to an instance of an object.
Setting session variable
somewhere in code behind of aspx page (myfile.aspx.cs)
HttpContext.Current.Session["ProjectID"] = Request.QueryString["Pid"].ToString();
Retrieving Session Variable
Normal Business Logic C# Class (Someclass.cs)
sProjectID = HttpContext.Current.Session["ProjectID"].ToString();
It gives me error on above line. It looks weird to me. can anyone explain this ?
Edit:
Call to class pass through generic handler (.ashx) page