I have images stored in the database in byte data type . And i get the byte array as the following :
Stream photo_stream = Photo_DAL.RetrievePhoto(int.Parse(reg);
byte[] photo_bytes = Photo_DAL.StreamToByteArray(photo_stream);
but I don’t know how to make the imageurl =”some url”??
I search and find some articles about handler , but really i don’t know how to use it.please How to read the image like this with some explanation ?
You could add a generic handler to your page (
MyImage.ashx):and then in some web form you could point the
ImageUrlproperty of anImagecontrol to the generic handler and pass the id of the image as query string parameter: