Last post Oct 22, 2018 06:31 AM by Fei Han - MSFT
Oct 18, 2018 11:36 AM|aspfun|LINK
I am looking for a control to display binary data as MemoryStream.
The binary source are converted from GIF, JPG, TIF, HTML image file and stored in a SQL table.
Oct 18, 2018 04:43 PM|PatriceSc|LINK
You could use the img tag or the
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.image.imageurl?view=netframework-4.7.2 as usual. The two options are to give the location of an image handler to which you pass the image id. This handler then retrieve image data from
the db and sent it back to the browser. You should really have tons of sample about how to do that. For example :
Another option is to use a
https://en.wikipedia.org/wiki/Data_URI_scheme (likely best for small images that won't need caching).
Oct 22, 2018 06:31 AM|Fei Han - MSFT|LINK
If you'd like to retrieve the binary image from your database, and display it in your web page, you can create and use a generic http handler to fetch the binary data of the image file from the database and returned the image data through the response.
This article explained with example, how to use
generic http handler to display binary images from database, please refer to it.