views:

137

answers:

1

I found out how to generate an image in code-behind based on some input from a webform, great. now i want to put that image back onto the form after the postback. All the samples i found use the Response to send the image back out to the browser with a stream.

Is there anyway to specify that the image generated in the code behind, be the source of a image control (or placeholder or whatever)?

If there is a way of doing this is there way of doing it without saving the image to the disk?

thanks

+1  A: 

The web browser has to be able to retrieve the image somehow. If you don't want to save it, then it will require sending it with a Response stream.

You can create an HTTP Handler (ashx) and based on query string parameters generate and return an image. This would allow you to specify the image objects "ImageUrl" property as "~/MyImageHandler.ashx?param1=value1"

Max Schmeling