Image Handler for Sharepoint Not Working

Posted by Peter on Stack Overflow See other posts from Stack Overflow or by Peter
Published on 2009-11-29T16:06:10Z Indexed on 2010/05/04 3:08 UTC
Read the original article Hit count: 184

Filed under:

My ImageHandler.ashx is not working when the webpart is calling it. any ideas on what is the correct way on calling or adding a handler in sharepoint? Thanks in advance

Here My ImageHandler.ashx code

    byte[] buffer = (byte[])image.ImageData;
    context.Response.ContentType = "image/jpeg";
    context.Response.OutputStream.Write(buffer, 0, buffer.Length);

In my webpart

imgcontrol.ImageUrl = "ImageHandler.aspx?id=1";

© Stack Overflow or respective owner

Related posts about sharepoint