I have an object returned to my front end which includes a load of strings and an image. I bind the strings to their labels etc, and now I want to display this image on screen. Is there a way to use an HTTPHandler to 'read' this image?
I've seen handlers that will go to the database and get the stream, but I already have the image, I just need to display it. I have tried asp:Image (requires a url) and image (which requires a src)
I suppose you could use an inline data src for your img tag (more info:
http://www.websiteoptimization.com/speed/tweak/inline-images/). Notice though that this way your image will not be cached. It's also not supported in IE versions earlier than 8 (and IE8 limits data uris to 32 Kb).
Alternatively you could create an HttpHandler that returns your image based on a key (or whatever you use to get to your data) and not load the data in your page.
Member
7 Points
29 Posts
Display Image HTTPHandler
Aug 09, 2012 07:35 AM|Nosferatu|LINK
I have an object returned to my front end which includes a load of strings and an image. I bind the strings to their labels etc, and now I want to display this image on screen. Is there a way to use an HTTPHandler to 'read' this image?
I've seen handlers that will go to the database and get the stream, but I already have the image, I just need to display it. I have tried asp:Image (requires a url) and image (which requires a src)
Contributor
2010 Points
385 Posts
Re: Display Image HTTPHandler
Aug 09, 2012 07:52 AM|Menno van den Heuvel|LINK
I suppose you could use an inline data src for your img tag (more info: http://www.websiteoptimization.com/speed/tweak/inline-images/). Notice though that this way your image will not be cached. It's also not supported in IE versions earlier than 8 (and IE8 limits data uris to 32 Kb).
Alternatively you could create an HttpHandler that returns your image based on a key (or whatever you use to get to your data) and not load the data in your page.
Menno