471,316 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 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 4826
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Matt | last post: by
1 post views Thread by kongkong99 | last post: by
reply views Thread by AngelaMDick | last post: by
4 posts views Thread by Peter | last post: by
reply views Thread by rosydwin | last post: by

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.