Pressin back on browser toolbar refetches the page

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
 
B

bloomfield

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.
 
I

interuser

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.
 
B

bloomfield

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
 
I

interuser

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top