0

While I am trying to retrieve session value from a generic handler, it throws "object reference not set to an object. Here is my code-

public class Upload : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
          Int32 UserId=Convert.ToInt32(context.Session["UserId"]);
    }

}

How to solve this issue?

Thank you.

UPDATE

This link solved my issue ASP.NET Generic Handlers & Session

Community
  • 1
  • 1
s.k.paul
  • 7,099
  • 28
  • 93
  • 168

0 Answers0