Handler.ashx file code :
public class ImageHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
Int32 theID;
if (context.Request.QueryString["AdminId"] != null)
theID = Convert.ToInt32(context.Request.QueryString["AdminId"]);
else
throw new ArgumentException("No parameter specified");
context.Response.ContentType = "image/jpeg";
Stream strm = DisplayImage(theID);
byte[] buffer = new byte[2048];
int byteSeq = strm.Read(buffer, 0, 2048);
while (byteSeq > 0)
{
context.Response.OutputStream.Write(buffer, 0, byteSeq);
byteSeq = strm.Read(buffer, 0, 2048);
}
}
public Stream DisplayImage(int theID)
{
SqlConnection connecti ...
Go to the complete details ...