Asp.Net: Help-I am passing a querystring to ShowImage.ashx of a Picture in ImageData1. It is being reconized as a is reconized as a 'System.Byte[]'

westdh
westdh used Ask the Experts™
on

I am passing a querystring to ShowImage.ashx of a Picture in ImageData1

<img alt="httpHandler" src="ShowImage.ashx?Picture='<%# Eval("ImageData1")%>'">

the problem is it ImageData1 is reconized as a 'System.Byte[]' meaning that it is still in a pack mode and needs to be streamed.

ShowImage.ashx?Picture='System.Byte[]'

------------------------------------------------------------------------------------------------------------
ShowImages.ashx code is in the code block and it needs correcting in order to unpack ImageData Binary Image Data to a displayable Image. I am stuck I donot no how....See Image also.


public void ProcessRequest (HttpContext context)
   {

         Response.ContentType = "image/jpeg"
         Response.Expires = 0
         Response.Buffer = True
         Response.Clear()
         string v = Request.QueryString["Picture"];
         respone.write("test: " + v)
         Response.BinaryWrite(CType(Request.QueryString("Picture"), Byte())
         HttpContext.Current.ApplicationInstance.CompleteRequest()

    }

}

Open in new window

sshot-9.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Your architecture needs improvement. It looks like you are trying to send the contents of an image as a query string parameter down to the client, then have the client send it back to the server in a handler request, which then sends it back to the client as an image. This is terribly inefficient, since each image is passed down to the browser twice and sent back to the server once.

Instead, just send the image ID down to the client, like this:

<img  alt="httpHandler" src="ShowImage.ashx?PictureId='<%#  Eval("ImageId")%>'">

Then, in your handler, use the ID to look up the image in the database and send it to the browser.

Author

Commented:
I have found the problem it is with the control it self.  I tried Telerix’s BinaryImageControl and it worked it allow me to page and login.

Author

Commented:
I have found the problem it is with the control it self.  I tried Telerix’s BinaryImageControl and it worked it allow me to page and login.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial