Reponse.write problem?

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hello,

I'm dynamically writing out a web page using response.write. The page has
images and hyperlinks (each hyperlink points back to the same page, but with
a different parameter which specifies a larger image that is loaded). When
I first bring up the page everything is fine. Then when I click on the
hyperlinks, the page reloads but has the exact same images. The only way to
view the new images is to hit 'REFRESH'. Is there something I am missing,
some way to clear the html contents before loading the page back up?
 
Check whether your entire URL (to any resource: page or image) is really
different.
If its not, check whether the page expires immediately.

- Joris
 
Thanks for your response! The URL is different, and I've tried setting
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(5), but that
doesn't work either. Also I've noticed, it looks like the new page is
loading up, but the previous page also loads on top of it, making it look
like there's no new page. Is there some way to just clear this out (I've
tried response.clear() but no luck).

Thanks!
 
Richard said:
Thanks for your response! The URL is different,

Thats indeed correct, are you sure the image refered to is different too?
and I've tried setting
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(5), but that

If you don't want caching:
Response.Caching.SetCachability(HttpCachability.NoCache)

This ensures the response is never cached (including server, proxies and
clients).

Dont use Reponse.Expires / ExpiresAbsolute, these are predicated in ASP.NET.
Use Reponse.Caching.SetExpires(System.DateTime.Now.AddSeconds(5));
Always use Reponse.Caching. said:
doesn't work either. Also I've noticed, it looks like the new page is
loading up, but the previous page also loads on top of it, making it look
like there's no new page. Is there some way to just clear this out (I've
tried response.clear() but no luck).

Response.Clear() works only when buffering is enabled.
You can ensure this in the <@ ... > line (first on on the page).

You might want to consider posting the (relevant) source up here...
<snip>

- Joris
 
Joris said:
Thats indeed correct, are you sure the image refered to is different
too?


If you don't want caching:
Response.Caching.SetCachability(HttpCachability.NoCache)

This ensures the response is never cached (including server, proxies
and clients).

No. A client does not need to adhere to Cache-Control headers, since a
browser history is not meant to behave like a cache -- the fact that many
browsers do is misleading.

Quoting section 13.13 of the HTTP 1.1 spec:

"History mechanisms and caches are different. In particular history
mechanisms SHOULD NOT try to show a semantically transparent view of the
current state of a resource. Rather, a history mechanism is meant to show
exactly what the user saw at the time when the resource was retrieved."


Cheers,
 
Back
Top