4
Answers

object reference not set to an instance of an object.

Dhruvi kukadiya

Dhruvi kukadiya

10y
3.1k
1
When i run below code it gives "object reference not set to an instance of an object."Exception on first line.


if ((context.Session["ImageBytes"]) != null)
        {
            byte[] image = (byte[])(context.Session["ImageBytes"]);
            context.Response.ContentType = "image/JPEG";
            context.Response.BinaryWrite(image);
        }
Answers (4)