I have 30 images and next to them there is a upload button.
When you select new image and press update, it should delete the old image and save the new image with the same name and path.
I do this with:
string path = "~/Pics/Image1.jpg";
System.IO.File.Delete(Server.MapPath(path));
uploadfile.SaveAs(path);
It works,i can see the change in my folder where i keep all of my images, but in the browser i see the old image and i need to delete my cache in order to see the new image.
Is there any way i can update my images and show the new images without deleting cache from the browser?
This is a browser caching issue as you suspect. What you can do is add a query string value or something along those lines so that the browser will have to reload the file.
The end result would be
image.jpg?image=randomNumberI usually do this through javascript and you can use generating-random-numbers-in-javascript-in-a-specific-range to help you figure that out.
Now just as a note you are only adding the querystring to the source of the image tag just in case I was not clear.