Trying to display "Page has Expired" message

Discussion in 'ASP General' started by Ed Burns, Aug 5, 2004.

  1. Ed Burns

    Ed Burns Guest

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ed Burns, Aug 5, 2004
    #1
    1. Advertising

  2. http://www.aspfaq.com/2022

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Ed Burns" <> wrote in message
    news:...
    >
    > 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
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Aaron [SQL Server MVP], Aug 5, 2004
    #2
    1. Advertising

  3. Ed Burns

    Ed Burns Guest

    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>")


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ed Burns, Aug 5, 2004
    #3
  4. 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.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Ed Burns" <> wrote in message
    news:...
    > 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>")
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Aaron [SQL Server MVP], Aug 5, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    2
    Views:
    492
    Cheung, Jeffrey Jing-Yen
    Jul 8, 2003
  2. Coder Coder

    Warning: Page has Expired

    Coder Coder, Jul 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    408
    Alvin Bruney
    Jul 30, 2003
  3. Mike
    Replies:
    1
    Views:
    689
    S. Justin Gengo
    Aug 8, 2003
  4. Quentin Huo
    Replies:
    0
    Views:
    350
    Quentin Huo
    Jun 21, 2004
  5. Fernando Chilvarguer

    Page Caching - Warning: Page has Expired

    Fernando Chilvarguer, Nov 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    541
    Joyjit Mukherjee
    Nov 19, 2004
Loading...

Share This Page