Pressin back on browser toolbar refetches the page

  • Thread starter Thread starter interuser
  • Start date Start date
I

interuser

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="pagexxx.aspx.vb" Inherits="pagexxx"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- #include virtual="/CommonUI/Include/Headers.htm" -->
<HTML>
<HEAD>
.....


"/CommonUI/Include/Headers.htm" has these contents:

<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader( "Pragma", "no-cache" ) %>
<% Response.Expires = -1 %>


With IE, I go to page A and then to page B. Then I press back and page
A is refetched from the webserver. What I want instead, is to display
the following message to the user:

"Warning: Page has Expired"

It used to work in the past with my application , but not any more.

Anobody knows what may be wrong and how I can fix it ?

Thanx
 
The message is displayed only if the page was obtained with a 'post'
method. To view this do the fallowing: from page A do a post (submit) to
the page A. After that go to page B and press back.
 
But that's what I do.
Anybody else can help?
Thx
bloomfield said:
The message is displayed only if the page was obtained with a 'post'
method. To view this do the fallowing: from page A do a post (submit) to
the page A. After that go to page B and press back.
 
Its because the page is not cached on the client but is retrieved every
time you make a request (including when you press the back button). The
lines
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader( "Pragma", "no-cache" ) %>
<% Response.Expires = -1 %>
are doing just that. If you remove them the page will be cached and the
browser will ask you when pressing the back button and the previous page
was obtained by a post.

Sorry i wasn't somebody else
 
The exact same pages used to work for me in the past, but not anymore.
I want to know what are the possible causes that make these directives
not to work as expected (ie return page has expired) instead of
refetching the page
 
Back
Top