refresh image in asp.net page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how to refresh a image control to pick up the latest image file on a asp.net
page. i am generating a image based on the input from the user and displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when i
hit the refresh button on the toolbar it correctly gets the latest image and
displays it in the control. But that has another problem, it pops up a dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes) and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra
 
You can trick the browser into reloading the image from the server by adding
a random query parameter to the image url. I am using a javascript call that
produces the millisecond part of the current time.

Eliyahu
 
Eliyahu said:
You can trick the browser into reloading the image from the server by
adding a random query parameter to the image url. I am using a
javascript call that produces the millisecond part of the current
time.

Or unleash the full power of HTTP by sending a Cache-Control: no-cache
header ;-)

Cheers,
 
Hi Eliyahu,

I have added the query string parameter (page.aspx?a=test) to the image url
but still the image doesn;t seem to get refreshed with the new one.

please clarify you suggestion.

thanks, Ramendra
 
I am new to Asp.net and therefore i am not able to understand your suggestion
or i am doing it in wrong way.

-RK
 
Back
Top