A very simple request: Refresh the Image control on your aspx page when you want to.
Scenario:
1.You want to refresh a specific image when a user clicks a button.
2.You want to refresh a specific image when that image has been changed.
3.You want to refresh a specific image periodically.
This won't work:
//strImagePath is a variable which stores the image path and filename
Image1.ImageUrl = strImagePath;
This will:
Image1.Attributes.Add("src", "strImagePath?ts=" + System.DateTime.Ticks);
In order to avoid the browser sending the old/cached image to client, we can change the value of the image's "src" property by giving a timestamp. We can also change the image file name (like image20090617.jpg -> image20090618.jpg -> image20090619.jpg), but this will require more steps and increase the complexity.