tags:

views:

25

answers:

1

I have a View where I can upload an image and the image is also displayed in there like this:

//ResourceStorage is a virtual directory that indicates to the pictures storage location
    <img src='<%=Url.Content("~/ResourceStorage/Profile/pic.jpg") %>' alt='pic' />  

after I upload the picture, on the hard drive I get the new "pic.jpg" but in the browser I still have the old one (I tried clearing the cache, doesn't help)

+2  A: 

Are you trying this in IIS or on your local Cassini development server?

Try this:

http://stackoverflow.com/questions/1930914/iis-7-force-fresh-images

Raj Kaimal
I'm doing it on IIS, and I just fixed it, [OutputCache(Location = OutputCacheLocation.None)] helped, don't know if this is the best solution though
Omu
If it is a static resource, then it is best that IIS cache it on your production server.
Raj Kaimal
it's not a static resource
Omu
and on Internet Explorer I still have to hit refresh once to get it right
Omu