title: How to use ISession and Session Variable in same .cs file and pass Session variable inHttpHandler?
body: <p>I am trying to use a Session variable in my cs file, and in the same cs file i am using ISession.</p>
  
  <p>Handler page..</p>
  
  <pre><code>int ImageID = Convert.ToInt32(context.Session["ImageId"]);
  </code></pre>
  
  <p>cs file...</p>
  
  <pre><code>    protected ISession Session
      {
          get { return Ioc.Resolve&lt;IWebSessionManager&gt;().CurrentSession; }
      }
  
  
       int ImagefId=objbal.GetImageID(Id);
       HttpContext.Current.Session["ImageId"] = ImagefId.ToString();
  </code></pre>
  
  <p>as i am going to next step while debugging I am getting Object reference not set to an instance of an object. on Handler page.</p>
  
  <p>and if I am trying to change in ISession Session name and HttpContext.Current.Session["ImageId"] to Session["ImageId"] then Session is showing the error Session does not exist in the currenct context.</p>
  
  <p>Someone plz help me to solve this...</p>