Setting Page Expiration...

Discussion in 'ASP .Net' started by Mustufa Baig, Apr 1, 2005.

  1. Mustufa Baig

    Mustufa Baig Guest

    Hi,

    Whenever the user clicks on Back Button, I want that page to be reloaded or
    refreshed. Basically I don't want my page to be cached. How can I acheive
    this functionality in asp.net?

    Regards,
    Mustufa Baig, Apr 1, 2005
    #1
    1. Advertising

  2. Mustufa Baig

    Mike Douglas Guest

    Hi,

    You can put this in your page_load

    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    Response.Cache.SetAllowResponseInBrowserHistory(false)

    This will make the so the page is expired.

    I hope this helps.

    Mike Douglas

    www.doitconsultants.com

    On Fri, 1 Apr 2005 14:59:04 -0500, "Mustufa Baig"
    <> wrote:

    >Hi,
    >
    >Whenever the user clicks on Back Button, I want that page to be reloaded or
    >refreshed. Basically I don't want my page to be cached. How can I acheive
    >this functionality in asp.net?
    >
    >Regards,
    >
    >
    Mike Douglas, Apr 1, 2005
    #2
    1. Advertising

  3. This will ensure the page doesn't get cached.

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

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "Mustufa Baig" <> wrote in message
    news:%...
    > Hi,
    >
    > Whenever the user clicks on Back Button, I want that page to be reloaded
    > or
    > refreshed. Basically I don't want my page to be cached. How can I acheive
    > this functionality in asp.net?
    >
    > Regards,
    >
    >
    >
    Steve C. Orr [MVP, MCSD], Apr 2, 2005
    #3
  4. Mustufa Baig

    Mustufa Baig Guest

    Hi Mike,

    I tried but the following is nt valid:

    Response.Cache.SetAllowResponseInBrowserHistory(false)

    Thanks.

    "Mike Douglas" <> wrote in message
    news:...
    > Hi,
    >
    > You can put this in your page_load
    >
    > Response.Cache.SetCacheability(HttpCacheability.NoCache)
    > Response.Cache.SetAllowResponseInBrowserHistory(false)
    >
    > This will make the so the page is expired.
    >
    > I hope this helps.
    >
    > Mike Douglas
    >
    > www.doitconsultants.com
    >
    > On Fri, 1 Apr 2005 14:59:04 -0500, "Mustufa Baig"
    > <> wrote:
    >
    > >Hi,
    > >
    > >Whenever the user clicks on Back Button, I want that page to be reloaded

    or
    > >refreshed. Basically I don't want my page to be cached. How can I acheive
    > >this functionality in asp.net?
    > >
    > >Regards,
    > >
    > >

    >
    Mustufa Baig, Apr 5, 2005
    #4
  5. Mustufa Baig

    Mustufa Baig Guest

    Hi Steve,

    Response.Expires = 0 is provided for backward compatibility. Whats the new
    way of getting this functionality?

    Thanks.

    "Steve C. Orr [MVP, MCSD]" <> wrote in message
    news:...
    > This will ensure the page doesn't get cached.
    >
    > Response.Expires = 0
    > Response.Cache.SetNoStore()
    > Response.AppendHeader("Pragma", "no-cache")
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://SteveOrr.net
    >
    >
    > "Mustufa Baig" <> wrote in message
    > news:%...
    > > Hi,
    > >
    > > Whenever the user clicks on Back Button, I want that page to be reloaded
    > > or
    > > refreshed. Basically I don't want my page to be cached. How can I

    acheive
    > > this functionality in asp.net?
    > >
    > > Regards,
    > >
    > >
    > >

    >
    >
    Mustufa Baig, Apr 5, 2005
    #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. Rickey Tom
    Replies:
    4
    Views:
    497
    Rickey Tom
    Jul 29, 2003
  2. Ken

    Page expiration

    Ken, Nov 1, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,125
    Guest
    Nov 3, 2003
  3. Vijay
    Replies:
    3
    Views:
    1,471
    Saravana [MVP]
    Nov 4, 2003
  4. 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
  5. naijacoder naijacoder

    Page expiration - Is it with Session.Timeout

    naijacoder naijacoder, Sep 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    437
    Greg Burns
    Sep 9, 2004
Loading...

Share This Page