Ryan Ryan - 3 months ago 14
ASP.NET (C#) Question

asp.net image control - how to put an image in it

I have a list of

System.Drawing.Image
. I want to update my asp.net
Image
control in the
Page_Load
event with the last image from that list.

I can only find properties like ImageURL. Can't I just do something like

ImageControl1.referenceToSomeImageObjectWhichWillBeDisplayed=myImageObjectFromTheList


is there any such property on the Image control?

Answer

No, there isn't.

To do what you want, you can write an HTTP Handler that returns the image and point the ImageUrl to it.

Here is one example of such a handler.

Comments