Trying to display "Page has Expired" message

E

Ed Burns

Hi. I am trying to disable a user from going back to a previous page and
displaying information previously shown. I want to give them the typical
"Page has Expired" warning message. I am using Win Server 2003. Does
anyone know what you have to do so that the user can only see the page
once and not to be able to click back and see a cached page.

Thanks!

Ed
 
E

Ed Burns

I tried exactly what the article said but it still does not work. It
looks like it should work. Should this page be inside of a frames page
in order to work?

The way I set up the test is that I have a page called 00.asp which has
a link to 01.asp (displayed below). 01.asp gets some records back from
the DB and outputs it. Then it displays a link to 02.asp. I follow the
link to 02.asp. Once on 02.asp I click on the back button in IE 6 and I
still get the full/cached 01.asp page and not the "Page has expired"
message. What am I doing wrong?

I did what the article said which is to use iisreset on the server and
cleared out my browser. It still does not work. Any ideas?

===============
Code: 01.asp
===============
option explicit

Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"

dim oConn, oRS, sql
set oConn = server.createobject("adodb.connection")
oConn.open "Provider=sqloledb; Data Source=dev; Initial
Catalog=pubs;User Id=sa;Password=dewey;"
Set oRS = Server.CreateObject("ADODB.Recordset")
sql = "select * from authors"
oRS.Open sql, oConn, adOpenForwardOnly, adLockPessimistic, adCmdText

if not oRS.EOF then
do while not oRS.EOF
response.write(oRS("au_Id") & "<br>")
oRS.MoveNext
loop
end if

oRS.close
Set oRS = nothing
oConn.close
set oConn = nothing

response.write("<br><br><a href='02.asp'>to page 2</a>")
 
A

Aaron [SQL Server MVP]

What has changed in 01.asp that would expect you to force it to show a page
has expired message? The page is not "not caching", it is reloading and
showing the content over again. If you want to force people to have to
actively refresh to see the content again, then in page 00.asp, post a form
instead of redirecting or clicking a link. The form can be empty.
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top