Reputation: 29749
In my web app I change photo uploaded by user but the path to it on the server remains the same. Is it possible after postback to force browser to reload that photo. Right kow it still displays old one. Thanks for help
Upvotes: 3
Views: 602
Reputation: 52241
It would be better if you use the AJAX AsyncFileUpload
file upload control, since it will give you what you are looking for right now.
http://asp.net-informations.com/ajax/ajax-AsyncFileUpload.htm
Upvotes: 0
Reputation: 935
Sounds like the browser is caching the image.
You can append a fake querystring argument with the current date time to the source of the image to force the browser to reload it every time the page loads.
Ex:
Image img = new Image();
img.ImageUrl = "~/pathToNewImage?q"+DateTime.Now.ToString();
Upvotes: 1
Reputation: 1
Yes, y not load and bind the grid once again which you use to display the photograph.
Upvotes: 0