Displaying Images using Gridview ASP.NET 2.0
-
Hi, I am currently trying to display images stored in a database using the new tool Gridview. However the images are stored as binary data in the database. Is there a way uisng Gridview to read this data and display the image? All I seem to be able to get is information on usin URL's to access the images, which does not fir my requirements. Many thanks in advance Paul Custance
-
Hi, I am currently trying to display images stored in a database using the new tool Gridview. However the images are stored as binary data in the database. Is there a way uisng Gridview to read this data and display the image? All I seem to be able to get is information on usin URL's to access the images, which does not fir my requirements. Many thanks in advance Paul Custance
You can either use the ImageField or TemplateField with an Image control, in the ImageUrl you can specify the url of a web page or a custom handler which is resposible for producing the image. In this web page ( or custom handler), you can simply save the binary data of the image into the output stream of the Response object. You can see the sample code in the Personal starter kit[^]