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.
It help me to solve the problem. Thanks a lot!
ReplyDeleteThank you so much! It solved mine too!
ReplyDeleteThank you so much Kenny.Its solved my problem.
ReplyDelete10x a lot
Parmesh
Thank you very much...
ReplyDeleteThanks a ton Friend. This one saved me on my B'Day.
ReplyDeleteThanks alot dear...
ReplyDeleteI have store Images in Database column, I am displaying all data in to grid view when I click on particular record on grid I am showing Photo of particular record on Page Image control. But when showing image all page is refreshing.
ReplyDelete