Monday, 1 October 2018

how to avoid image getting loaded from the cache in Asp.Net

images are load from cache how to load new image in asp.net


Description:

In this example, we explain that how to remove images from browser cache when image is changed in Asp.Net.or how to avoid image getting loaded from the cache. Alternatively, image are loaded from cache so how can I load new images instead of old image in Asp.net.

Therefore, there are many questions raised like how to load new, image every time when image is changed instead of loading image from cache in browser in Asp.Net.or by default browser load image from cache when image is changed.

Now since it is not possible to clear cache of user’s browser from server side. We can use the following trick

Code:

Image1.ImageUrl = "~/images/myImage.jpg?" + DateTime.Now.Ticks.ToString();

0 comments:

Post a Comment