Page Expiry

J

jack-e

Hi,

What is the best way to deal with the "back button" problem i.e. person
clicking back and resubmitting details again.

Page Expiry? If so, how do I set this?

Thanks in advance.
 
T

tschulken

Not sure if this is what you are looking for but in my scenario I
didn't want users hitting the back button and looking at old data b/c
they just hit submit. In the page_load event I set the page not to
cache it's data so that when you hit Back, it is refreshing itself each
time. Here is my code .......

' This makes sure that when the Back button is hit, the page
won't be
' cached, ensuring that it is re-loaded.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
 
J

Juan T. Llibre

Patrick,

First of all, that is *not* a "Scott article".

It's an old, dated, ASP, not ASP.NET, article by Akhilesh Reddy,
based on very old information in an even older article by Phil Paxton.

Secondly, the techniques in that article do *not* solve
the problem if you're programming using ASP.NET.

Thirdly, the technique which *does* work was sent in by tschulken:

Response.Cache.SetCacheability(HttpCacheability.NoCache)
*That* works in ASP.NET...for all browsers.

*Please* try to research your proposed solutions a bit more
before sending in what turns out to be misleading information.

Thank you.
 
J

Joerg Jooss

Juan said:
Patrick,

First of all, that is not a "Scott article".

It's an old, dated, ASP, not ASP.NET, article by Akhilesh Reddy,
based on very old information in an even older article by Phil Paxton.

Secondly, the techniques in that article do not solve
the problem if you're programming using ASP.NET.

Thirdly, the technique which does work was sent in by tschulken:

Response.Cache.SetCacheability(HttpCacheability.NoCache)
*That* works in ASP.NET...for all browsers.

Unfortunately, this is not true (check out Opera, put a HTTP 1.0 proxy
in between, yada yada). The HTTP spec even wants user agents to serve
local copies when using the "back button" regardless of page expiration
or cache control. But many browser implementations do not follow that
notion and apply caching headers and expiration dates to their
histories.

What makes it even worse is that there is at least one terrible bug in
IE's HTTP header parser, which causes it to react differently on
semantically equivalent Cache-Control headers.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top