Re: Warning Page Has Expired, I need to turn it OFF for a simple search page

Discussion in 'ASP .Net' started by Kevin Spencer, Jul 8, 2003.

  1. You can't turn it off. If you understand the reason for it, then you know
    that the Back button or Refresh button of a browser makes a new request for
    a page. If that page was returned by some server-side form handler, the only
    way to get that page back is to re-submit the form that the handler
    processed to produce the page. There are some workarounds for it, but they
    all involve not posting a form to get the page, such as changing the
    location property of the document, rather than doing a PostBack.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.

    "Mike" <> wrote in message
    news:...
    > I have a simple search on a page, when you search a list of regular links
    > come up, you click a like look at the info and then hit the back button

    and
    > get "Warning Page Has Expired". On other pages in the same site back

    works
    > fine as long as a form has not been posted.
    >
    > I understand the reason for this and also have read many post on this
    > subject, but I still cannot figure out how to turn this off for just this
    > one page.
    >
    > I have tried:
    >
    > <%@ OutputCache VaryByParam="value" Duration=180 Location="Client" %>
    >
    > and
    >
    > Context.Response.Cache.SetCacheability(HttpCacheability.Private);
    >
    > Context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180));
    >
    >
    >
    >
    >
     
    Kevin Spencer, Jul 8, 2003
    #1
    1. Advertising

  2. Kevin Spencer

    Mike Guest

    Requiring a repost makes sense in many cases, but not in others, my search
    is a good example: A list of product apears, you click one and hyperlink to
    see it and then click your back button. I simply dont care if the browser
    displays the page after the post was done, actually I want that behavior.
    Why force the client to re-run the same search, or click some special back
    button that displays some cache of their search.

    Am I going about this the wrong way?

    If there is really no way to turn this off on a case by case basis, that
    really stinks, but there has got to be a way, somebody has to have figured
    this out.

    Thanks

    Mike


    "Kevin Spencer" <> wrote in message
    news:#...
    > You can't turn it off. If you understand the reason for it, then you know
    > that the Back button or Refresh button of a browser makes a new request

    for
    > a page. If that page was returned by some server-side form handler, the

    only
    > way to get that page back is to re-submit the form that the handler
    > processed to produce the page. There are some workarounds for it, but they
    > all involve not posting a form to get the page, such as changing the
    > location property of the document, rather than doing a PostBack.
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft FrontPage MVP
    > Internet Developer
    > http://www.takempis.com
    > Some things just happen.
    > Everything else occurs.
    >
    > "Mike" <> wrote in message
    > news:...
    > > I have a simple search on a page, when you search a list of regular

    links
    > > come up, you click a like look at the info and then hit the back button

    > and
    > > get "Warning Page Has Expired". On other pages in the same site back

    > works
    > > fine as long as a form has not been posted.
    > >
    > > I understand the reason for this and also have read many post on this
    > > subject, but I still cannot figure out how to turn this off for just

    this
    > > one page.
    > >
    > > I have tried:
    > >
    > > <%@ OutputCache VaryByParam="value" Duration=180 Location="Client" %>
    > >
    > > and
    > >
    > > Context.Response.Cache.SetCacheability(HttpCacheability.Private);
    > >
    > > Context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180));
    > >
    > >
    > >
    > >
    > >

    >
    >
     
    Mike, Jul 8, 2003
    #2
    1. Advertising

  3. Re: Warning Page Has Expired, I need to turn it OFF for a simplesearch page

    Mike,

    This has nothing to do with caching, rather just the way your form
    interprets posted data. If you're enabling viewstate (expensive), then
    this should resolve any "forced refreshes" as the posted data should be
    remembered in the viewstate data.

    HTH,

    Jeff Cheung

    Mike wrote:

    > Requiring a repost makes sense in many cases, but not in others, my search
    > is a good example: A list of product apears, you click one and hyperlink to
    > see it and then click your back button. I simply dont care if the browser
    > displays the page after the post was done, actually I want that behavior.
    > Why force the client to re-run the same search, or click some special back
    > button that displays some cache of their search.
    >
    > Am I going about this the wrong way?
    >
    > If there is really no way to turn this off on a case by case basis, that
    > really stinks, but there has got to be a way, somebody has to have figured
    > this out.
    >
    > Thanks
    >
    > Mike
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:#...
    >
    >>You can't turn it off. If you understand the reason for it, then you know
    >>that the Back button or Refresh button of a browser makes a new request

    >
    > for
    >
    >>a page. If that page was returned by some server-side form handler, the

    >
    > only
    >
    >>way to get that page back is to re-submit the form that the handler
    >>processed to produce the page. There are some workarounds for it, but they
    >>all involve not posting a form to get the page, such as changing the
    >>location property of the document, rather than doing a PostBack.
    >>
    >>HTH,
    >>
    >>Kevin Spencer
    >>Microsoft FrontPage MVP
    >>Internet Developer
    >>http://www.takempis.com
    >>Some things just happen.
    >>Everything else occurs.
    >>
    >>"Mike" <> wrote in message
    >>news:...
    >>
    >>>I have a simple search on a page, when you search a list of regular

    >
    > links
    >
    >>>come up, you click a like look at the info and then hit the back button

    >>
    >>and
    >>
    >>>get "Warning Page Has Expired". On other pages in the same site back

    >>
    >>works
    >>
    >>>fine as long as a form has not been posted.
    >>>
    >>>I understand the reason for this and also have read many post on this
    >>>subject, but I still cannot figure out how to turn this off for just

    >
    > this
    >
    >>>one page.
    >>>
    >>>I have tried:
    >>>
    >>><%@ OutputCache VaryByParam="value" Duration=180 Location="Client" %>
    >>>
    >>>and
    >>>
    >>>Context.Response.Cache.SetCacheability(HttpCacheability.Private);
    >>>
    >>>Context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180));
    >>>
    >>>
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Cheung, Jeffrey Jing-Yen, Jul 8, 2003
    #3
    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. Coder Coder

    Warning: Page has Expired

    Coder Coder, Jul 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    409
    Alvin Bruney
    Jul 30, 2003
  2. Mike
    Replies:
    1
    Views:
    690
    S. Justin Gengo
    Aug 8, 2003
  3. bri

    Warning: Page has Expired

    bri, Nov 20, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    4,406
    Kevin Spencer
    Nov 20, 2003
  4. Fernando Chilvarguer

    Page Caching - Warning: Page has Expired

    Fernando Chilvarguer, Nov 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    542
    Joyjit Mukherjee
    Nov 19, 2004
  5. robert112
    Replies:
    1
    Views:
    478
    Juan T. Llibre
    Apr 26, 2007
Loading...

Share This Page