ebattulga
ebattulga

Reputation: 10981

how to change cached picture from javascript

I have a asp image control. ImageUrl="images/avator.jpg". I'm changing this picture on the server and then setting imageUrl same as previous url on the client. but image don't changed. When i click refresh button, image changed. How to change cached image won't changing url?

Upvotes: 2

Views: 189

Answers (1)

Eldar Djafarov
Eldar Djafarov

Reputation: 24685

You can add random number as a paramentr to avoid caching.

<img src="http://someurl.com/avatar.png?version=0.01.135";

The best way is to add number of application build version. So every time you change something in aplpication everything will load again.

Upvotes: 5

Related Questions