wtbonnell Posted January 17, 2005 Posted January 17, 2005 I am writing a Asp.Net (in C#) web app and I am looking for a way to dynamically force a complete refresh (it would be like hitting "Ctrl-F5" to refresh the browser). This is basically the situation: This web app is a gallery full of thumbnails and I allow the admin to edit the file name of each thumbnail. However, if an admin types in a file name that already exists, they are prompted to either "Replace" the image already there with this one or "Rename" this image to something else. If they choose "Replace" then I have the system delete the existing image/content, and then move this image to this new name. After the postback the old thumbnail still remains, HOWEVER, if I do a "Ctrl-F5" then the correct image appears. It looks the images are being cached (which is good) but is there a way I can disengage this caching when a new image is replacing an old image (with the same name) OR a way to force a complete refresh? Thanks for your help... Quote
kahlua001 Posted January 17, 2005 Posted January 17, 2005 After the update, try appending the image source with a random querystring like src="image.gif?date=" & now() IE will load a new image becuase it has never seen this path before. Quote
wtbonnell Posted January 17, 2005 Author Posted January 17, 2005 That may be a possible work-around, but I am hoping there is a more efficient way. If not, then this is a good soltuion. Thanks Quote
*Gurus* Derek Stone Posted January 18, 2005 *Gurus* Posted January 18, 2005 The solution kahlua001 mentioned is indeed the best method in most situations. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.