Last post Oct 14, 2007 02:44 PM by altertoby
Jan 11, 2007 05:48 AM|SamuraiProgrammer|LINK
I know this will seem silly, but here is my predicament. I have an updatepanel on the page surrounding an asp:image control. It is essentially a User's profile picture. There is a link next to the picture to allow the user to change their picture. It
All image downloads run through a custom httphandler that write out the bytes for the image (stored in the DB) and assigns that value to the ImageURL property of the asp:image control.
In IE v6.xxx, when the update panel refreshes, the image does as well. However, in Firefox it does not. I know that the updatepanel is indeed posting back, but the browser is not requesting the image again from the httphandler.
Is there any way to force an image not to be cached in Firefox? I know that this is considered a feature and in most scenarios I would agree - but this is one situation where I *need* the browser to request the image again.
I haven't tested this in IE 7 yet - what type of behavior can I expect?
I'd really like to avoid an entire page refresh just to refresh an image if I can help it.
Jan 11, 2007 02:46 PM|Rama Krishna|LINK
Jan 11, 2007 07:15 PM|SamuraiProgrammer|LINK
Thank you for your response. I ended up going with about the same. During each page load, I append a non-sensical random number querystring value to the end of the link. It's certainly not elegant.
Appearantly, though, you can set the cacheability of a page using the following command:
The places where I saw it used was to make sure that a user couldn't click the 'Back' button on their browser after logging out of a site. I attempted to do the same thing in my httphandler, but it didn't work, although I'm not certain why it didn't.
At least this is a ready workaround until I figure out the more elegant and focused solution, me-thinks.
Thank you for the input.
Jan 12, 2007 01:02 PM|stmarti|LINK
You can check some advanced cache settings in firefox. Maybe you can figure out the difference between firefox and ie image caching.
Using about:config in firefox. I would start
Feb 27, 2007 10:57 PM|mikebridge|LINK
Did anyone find the ultimate reason for this? I have an UpdatePanel which contains a 3rd-party control which displays an image via an HttpHandler. The control produces a url which renders an image, but I don't have any control over this URL from C#, so
I can't append a random string on the end. I can update the control to render a new image, but the image doesn't get refreshed in Firefox or IE until I refresh the cache manually. Setting "NoCache" doesn't seem to help.
Oct 14, 2007 02:44 PM|altertoby|LINK
var prm = Sys.WebForms.PageRequestManager.getInstance();
var c = 0;
function pageLoaded(sender, args)
var img = document.getElementById("Control");
img.src = img.src + "?" + c;
and replace "Control" with the name of your control. For me it works.