I have a handler which creates an image. I call the handler when controls on the main page change, and those changes may change the pixel size of the image.
I tell the caller the new (display) size by using Session variables, setting them from within the handler.
The handler returns the URL of the image file, assigned to an image object in the Default.aspx page. This seems to work well.
It seems to me that while the handler always returns the correct URL of the image, it takes time (there is a delay) in either interrogating or setting the SessionState variables, so the size of the image on display is not always correct.
The code:
OutputImage.ImageUrl = "Handler1.ashx?" +
GlobConsts.sCouponTag + "=" + sCoupon + "&" +
GlobConsts.sModelTag + "=" + sModel + "&" +
...
Go to the complete details ...