Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Faulk - 08 Jun 2007 17:31 GMT
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>
Bill Faulk - 18 Jun 2007 16:34 GMT
Anybody?

>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
[quoted text clipped - 43 lines]
>  </body>
> </html>
Alvin Bruney [MVP] - 30 Jun 2007 23:34 GMT
don't post to so many newsgroups, folks usually avoid answering those types
of post. Have a look at the setcacheability enum (or some name similar to
this), set it to none. That should work.

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley

> Anybody?
>
[quoted text clipped - 46 lines]
>>  </body>
>> </html>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.