473,378 Members | 1,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Avoiding "page cannot be displayed" with no cache on IE6

I want to avoid letting users use the back button on forms with multiple
postbacks so I use Response.Cache.SetNoStore() for these pages. This works
fine for IE7 and Firefox by showing the desired "this page is expired"
message for those browsers. IE6 just shows a "the page cannot be displayed"
error.

Is there any way to avoid the error for IE6 and just show the page as
expired when the user presses the back button?

If there's any client setting, web.config setting (browserCaps?), or coding
to get this to work please let me know.

As a simple test, here's a sample from the documentation that demonstrated
what I see. Press submit a few times and then use the back button.

<%@ Page language="c#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HttpCachePolicy - SetNoStore - C# Example</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Prevent the browser from caching the ASPX page
Response.Cache.SetNoStore();

// Display the DateTime value.
Label1.Text = DateTime.Now.ToLongTimeString();
}
</script>
</head>
<body>
<form id="Form1" method="post" runat="server">
<h3>HttpCachePolicy - SetNoStore - C# Example</h3>

<p>Click the Submit button a few times, and then click the Browser's
Back button.<br />
You should get a "Warning: Page has Expired" error message.</p>

<p>Time: <asp:Label id="Label1" runat="server" Font-Bold="True"
ForeColor="Red" /></p>

<asp:Button id="Button1" runat="server" Text="Submit" />
</form>
</body>
</html>
Jun 8 '07 #1
1 4936
Anybody?

"Bill Faulk" <bi***@NOSPMxmission.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I want to avoid letting users use the back button on forms with multiple
postbacks so I use Response.Cache.SetNoStore() for these pages. This works
fine for IE7 and Firefox by showing the desired "this page is expired"
message for those browsers. IE6 just shows a "the page cannot be displayed"
error.

Is there any way to avoid the error for IE6 and just show the page as
expired when the user presses the back button?

If there's any client setting, web.config setting (browserCaps?), or
coding to get this to work please let me know.

As a simple test, here's a sample from the documentation that demonstrated
what I see. Press submit a few times and then use the back button.

<%@ Page language="c#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HttpCachePolicy - SetNoStore - C# Example</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Prevent the browser from caching the ASPX page
Response.Cache.SetNoStore();

// Display the DateTime value.
Label1.Text = DateTime.Now.ToLongTimeString();
}
</script>
</head>
<body>
<form id="Form1" method="post" runat="server">
<h3>HttpCachePolicy - SetNoStore - C# Example</h3>

<p>Click the Submit button a few times, and then click the Browser's
Back button.<br />
You should get a "Warning: Page has Expired" error message.</p>

<p>Time: <asp:Label id="Label1" runat="server" Font-Bold="True"
ForeColor="Red" /></p>

<asp:Button id="Button1" runat="server" Text="Submit" />
</form>
</body>
</html>

Jun 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email...
3
by: Ed Burns | last post by:
Hi. I am trying to disable a user from going back to a previous page and displaying information previously shown. I want to give them the typical "Page has Expired" warning message. I am using Win...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
1
by: JohnZing | last post by:
i tried to install asp.net forums all went ok, but after login i always get "Object moved to here." in firefox or "The page cannot be displayed" in IE when i hit refresh, the page loads fine. ...
1
by: kongkong99 | last post by:
Hi, I have an ASP.NET application that loads files, parses them and loads in the database which is running in window 2000 webserver. When I load a text file after the file is parsed and the...
1
by: emon.haider | last post by:
Hi guys, I just made a web application using ASP.Net and C#. The application compiles and works fine from my workstation, but after I uploaded it to my webserver, I am getting an error of "the...
0
by: AngelaMDick | last post by:
AngelaMD...@gmail.com View profile More options 12 Nov, 14:43 Newsgroups: microsoft.public.dotnet.csharp.general From: AngelaMD...@gmail.com Date: Mon, 12 Nov 2007 06:43:21 -0800 Local: Mon...
6
by: TC | last post by:
Hey All, I'm receiving a weird error in IE now: "The XML page cannot be displayed" This is even with the simplest of pages that I previously could view. Any ideas?
4
by: Peter | last post by:
I have the following code which works fine in IE6 and IE7 and FireFox, but when I run IE6 on Citrix I get "The page cannot be displayed" in the iframe. We don't have IE7 on Citrix so I can't try...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.