Page Expiry

Discussion in 'ASP .Net' started by jack-e, Jun 3, 2005.

  1. jack-e

    jack-e Guest

    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.
    jack-e, Jun 3, 2005
    #1
    1. Advertising

  2. jack-e

    tschulken Guest

    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)
    tschulken, Jun 3, 2005
    #2
    1. Advertising

  3. Patrick Olurotimi Ige, Jun 3, 2005
    #3
  4. 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.



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    Ven, y hablemos de ASP.NET...
    ======================

    "Patrick Olurotimi Ige" <> wrote in message
    news:OfHwrG%...
    > Jack..
    > Scott article here would help..
    > http://www.4guysfromrolla.com/webtech/111500-1.shtml
    > Patrick
    Juan T. Llibre, Jun 3, 2005
    #4
  5. jack-e

    Joerg Jooss Guest

    Juan T. Llibre wrote:

    > 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,
    --
    http://www.joergjooss.de
    mailto:
    Joerg Jooss, Jun 3, 2005
    #5
  6. jack-e

    jack-e Guest

    Thanks for all your responses.
    jack-e, Jun 6, 2005
    #6
    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. Thotatri

    Frequent session time Expiry

    Thotatri, Jul 21, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    441
    Thotatri
    Jul 21, 2003
  2. Charles Mifsud

    Page Caching and Page Expiry

    Charles Mifsud, Aug 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    Charles Mifsud
    Aug 7, 2006
  3. Walter Psaila

    Page Expiry Problem

    Walter Psaila, Aug 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    317
    Walter Psaila
    Aug 12, 2006
  4. Darick
    Replies:
    3
    Views:
    145
    Sherm Pendley
    Oct 18, 2004
  5. Replies:
    4
    Views:
    122
    Dr John Stockton
    Jul 30, 2005
Loading...

Share This Page