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