Page expiration

Discussion in 'ASP .Net' started by Ken, Nov 1, 2003.

  1. Ken

    Ken Guest

    After searching through the visual studio .net help, and
    searching on the web, I cannot find a difinitive way to
    make a page expire so that when a user clicks on the back
    button, the browser displays the "page has expireded"
    message. I've not found any combinations of
    response.cache members that provide for this
    functionality. I'd appreciate any help.
    Ken, Nov 1, 2003
    #1
    1. Advertising

  2. Re : Page expiration

    Hi

    Try the following code

    response.Cache.Setexpires(somepastdate)
    response.cache.setcacheability(Httpcacheability.nocache)

    - Gopi
    S Gopikrishna, Nov 1, 2003
    #2
    1. Advertising

  3. Ken

    Guest Guest

    Re : Page expiration

    Gopi,

    With this code in the page_load event

    System.DateTime dt = new DateTime
    (1961, 1, 5, 1, 1, 1, 1);
    Response.Cache.SetExpires(dt);
    Response.Cache.SetCacheability
    (HttpCacheability.NoCache);


    I can bring up the page, navigate to a different page,
    then click my browsers back button and the page displays,
    no "this page has expired message".

    >-----Original Message-----
    >Hi
    >
    >Try the following code
    >
    >response.Cache.Setexpires(somepastdate)
    >response.cache.setcacheability(Httpcacheability.nocache)
    >
    >- Gopi
    >.
    >
    Guest, Nov 1, 2003
    #3
  4. Try this code:

    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Ken" <> wrote in message
    news:002501c3a093$f4388f90$...
    > After searching through the visual studio .net help, and
    > searching on the web, I cannot find a difinitive way to
    > make a page expire so that when a user clicks on the back
    > button, the browser displays the "page has expireded"
    > message. I've not found any combinations of
    > response.cache members that provide for this
    > functionality. I'd appreciate any help.
    Steve C. Orr [MVP, MCSD], Nov 2, 2003
    #4
  5. Ken

    Guest Guest

    Super! This works.

    Thanks for the help.
    >-----Original Message-----
    >Try this code:
    >
    >Response.Expires = 0
    >Response.Cache.SetNoStore()
    >Response.AppendHeader("Pragma", "no-cache")
    >
    >--
    >I hope this helps,
    >Steve C. Orr, MCSD, MVP
    >http://Steve.Orr.net
    >Hire top-notch developers at http://www.able-

    consulting.com
    >
    >
    >
    >"Ken" <> wrote in

    message
    >news:002501c3a093$f4388f90$...
    >> After searching through the visual studio .net help,

    and
    >> searching on the web, I cannot find a difinitive way to
    >> make a page expire so that when a user clicks on the

    back
    >> button, the browser displays the "page has expireded"
    >> message. I've not found any combinations of
    >> response.cache members that provide for this
    >> functionality. I'd appreciate any help.

    >
    >
    >.
    >
    Guest, Nov 3, 2003
    #5
    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. Vijay
    Replies:
    3
    Views:
    1,471
    Saravana [MVP]
    Nov 4, 2003
  2. Josh Anderson - remove Zs to reply

    Page expiration warning on back navigation

    Josh Anderson - remove Zs to reply, Nov 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,336
    Saravana [MVP]
    Nov 19, 2003
  3. naijacoder naijacoder

    Page expiration - Is it with Session.Timeout

    naijacoder naijacoder, Sep 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    436
    Greg Burns
    Sep 9, 2004
  4. Nitin

    Page Expiration

    Nitin, Mar 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,116
    Patrick Olurotimi Ige
    Mar 3, 2005
  5. Mustufa Baig

    Setting Page Expiration...

    Mustufa Baig, Apr 1, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,924
    Mustufa Baig
    Apr 5, 2005
Loading...

Share This Page