[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

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

Bill Faulk

6/8/2007 4:31:00 PM

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/x... >
<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>


7 Answers

Bill Faulk

6/18/2007 3:34:00 PM

0

Anybody?

"Bill Faulk" <billf@NOSPMxmission.com> wrote in message
news:%23GMbzpeqHHA.1204@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/x... >
> <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>
>


Alvin Bruney [MVP]

6/30/2007 10:34:00 PM

0

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.

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


"Bill Faulk" <billf@NOSPMxmission.com> wrote in message
news:%23F33j4bsHHA.4612@TK2MSFTNGP04.phx.gbl...
> Anybody?
>
> "Bill Faulk" <billf@NOSPMxmission.com> wrote in message
> news:%23GMbzpeqHHA.1204@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/x... >
>> <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>
>>
>
>


JayPee Vee

3/19/2010 5:56:00 AM

0

On 19 Mrz., 05:08, "Djay" <Areyoukidding...@wild.net> wrote:
> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> news:4f02101a-f3eb-400f-83bd-8e4c99e85e06@f8g2000yqn.googlegroups.com...
>
>
>
>
>
> > On 18 Mrz., 18:31, "Bob" <n...@email.address> wrote:
> >> I received my census package on March 17, 2010.
> >> It contained a letter dated March 15, 2010. In this
> >> letter, the last sentence of the first paragraph is in bold
> >> and says "Please complete and mail back the enclosed
> >> census form today".
>
> >> Question 1 on the census form:
>
> >> "How many people were living or staying in this
> >> house, apartment, or mobile home on April 1, 2010?"
>
> > Your point?
> > Or do you consider this question an intrusion in your private life?
> > Gee, boycott bob, are you trying to win a bet by being so fucking
> > stupid?
>
> Gawd man look at a calendar will you?  Moron.

Your point?
I know how many people will be living with me on April 1st, cunt.

Tim Crowley

3/19/2010 12:38:00 PM

0

On Mar 18, 4:39 pm, "Bob" <n...@email.address> wrote:
> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> news:4f02101a-f3eb-400f-83bd-8e4c99e85e06@f8g2000yqn.googlegroups.com...
>
> > On 18 Mrz., 18:31, "Bob" <n...@email.address> wrote:
> >> I received my census package on March 17, 2010.
> >> It contained a letter dated March 15, 2010. In this
> >> letter, the last sentence of the first paragraph is in bold
> >> and says "Please complete and mail back the enclosed
> >> census form today".
>
> >> Question 1 on the census form:
>
> >> "How many people were living or staying in this
> >> house, apartment, or mobile home on April 1, 2010?"
>
> > Your point?
>
> Once again, you show you are as stupid as the people
> who sent this mailing. How can I answer question 1 and
> complete and mail back the form on March 17th? Perhaps
> I should answer it "unknown" on March 17th, and mail
> it back.
>
> > Or do you consider this question an intrusion in your private life?
> > Gee, boycott bob, are you trying to win a bet by being so fucking
> > stupid?
>
> Are you embarrassed yet?

I'm embarrassed that there are people living in America as woefully
sad an ignorant as you. I can't be half as embarrassed as your
family. How sad for them.


hint: you're a fucking retard.

Tim Crowley

3/19/2010 12:50:00 PM

0

On Mar 18, 4:39 pm, "Bob" <n...@email.address> wrote:
> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> news:4f02101a-f3eb-400f-83bd-8e4c99e85e06@f8g2000yqn.googlegroups.com...
>
> > On 18 Mrz., 18:31, "Bob" <n...@email.address> wrote:
> >> I received my census package on March 17, 2010.
> >> It contained a letter dated March 15, 2010. In this
> >> letter, the last sentence of the first paragraph is in bold
> >> and says "Please complete and mail back the enclosed
> >> census form today".
>
> >> Question 1 on the census form:
>
> >> "How many people were living or staying in this
> >> house, apartment, or mobile home on April 1, 2010?"
>
> > Your point?
>
> Once again, you show you are as stupid as the people
> who sent this mailing. How can I answer question 1 and
> complete and mail back the form on March 17th? Perhaps
> I should answer it "unknown" on March 17th, and mail
> it back.
>
> > Or do you consider this question an intrusion in your private life?
> > Gee, boycott bob, are you trying to win a bet by being so fucking
> > stupid?
>
> Are you embarrassed yet?

I'm embarrassed that there are people living in America as woefully
sad an ignorant as you. I can't be half as embarrassed as your
family. How sad for them.


hint: you're a fucking retard.

JayPee Vee

3/19/2010 4:10:00 PM

0

On 19 Mrz., 14:33, "Bob" <n...@email.address> wrote:
> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> news:92074788-a6e6-49d5-8f93-dd803cea217b@q15g2000yqj.googlegroups.com...
>
>
>
>
>
> > On 19 Mrz., 00:39, "Bob" <n...@email.address> wrote:
> >> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> >>news:4f02101a-f3eb-400f-83bd-8e4c99e85e06@f8g2000yqn.googlegroups.com...
>
> >> > On 18 Mrz., 18:31, "Bob" <n...@email.address> wrote:
> >> >> I received my census package on March 17, 2010.
> >> >> It contained a letter dated March 15, 2010. In this
> >> >> letter, the last sentence of the first paragraph is in bold
> >> >> and says "Please complete and mail back the enclosed
> >> >> census form today".
>
> >> >> Question 1 on the census form:
>
> >> >> "How many people were living or staying in this
> >> >> house, apartment, or mobile home on April 1, 2010?"
>
> >> > Your point?
>
> >> Once again, you show you are as stupid as the people
> >> who sent this mailing. How can I answer question 1 and
> >> complete and mail back the form on March 17th? Perhaps
> >> I should answer it "unknown" on March 17th, and mail
> >> it back.
>
> > So you don't know how many people will be living in your house on
> > April 1?
>
> That is impossible to know.

You're incapable of saying how many people will be living in your
house in ten days?
Do you think that acting stupid is proving anything, boycott bob?

>
> >> > Or do you consider this question an intrusion in your private life?
> >> > Gee, boycott bob, are you trying to win a bet by being so fucking
> >> > stupid?
>
> >> Are you embarrassed yet?
>
> > For what?
>
> At first it should have been for overlooking the
> dates in my post, which was obviously the point.
> Now, you should be embarrassed for the cover
> up.-

Actually, boycott bob, that's the difference between being proud and
being vain. If you were proud, you wouldn't post a tenth of the stupid
bullshit you've been writing for years. You're so amazingly stupid
that it should be considered a miracle that you even know how to use a
computer. But since you're vain, you "think" that acting like a
mentally-challenged goose stepping fascist is somethow contributing
anything to your cause.
Has it occured to you that most of your postings remained unanswered?
If it wasn't from me and Syd9, most of the time, no one -from either
side of the political spectrum- would even bother answering to you.
Anyone with pride would take that a clear sign... Not you...
Aren't you tired of being an idiot?

JayPee Vee

3/19/2010 9:59:00 PM

0

On 19 Mrz., 18:42, "Bob" <n...@email.address> wrote:
> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> news:c6604d6d-5285-448a-8d75-c8150b17722a@d27g2000yqf.googlegroups.com...
>
>
>
>
>
> > On 19 Mrz., 14:33, "Bob" <n...@email.address> wrote:
> >> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> >>news:92074788-a6e6-49d5-8f93-dd803cea217b@q15g2000yqj.googlegroups.com...
>
> >> > On 19 Mrz., 00:39, "Bob" <n...@email.address> wrote:
> >> >> "JayPee Vee" <jaypee1...@gmail.com> wrote in message
>
> >> >>news:4f02101a-f3eb-400f-83bd-8e4c99e85e06@f8g2000yqn.googlegroups.com...
>
> >> >> > On 18 Mrz., 18:31, "Bob" <n...@email.address> wrote:
> >> >> >> I received my census package on March 17, 2010.
> >> >> >> It contained a letter dated March 15, 2010. In this
> >> >> >> letter, the last sentence of the first paragraph is in bold
> >> >> >> and says "Please complete and mail back the enclosed
> >> >> >> census form today".
>
> >> >> >> Question 1 on the census form:
>
> >> >> >> "How many people were living or staying in this
> >> >> >> house, apartment, or mobile home on April 1, 2010?"
>
> >> >> > Your point?
>
> >> >> Once again, you show you are as stupid as the people
> >> >> who sent this mailing. How can I answer question 1 and
> >> >> complete and mail back the form on March 17th? Perhaps
> >> >> I should answer it "unknown" on March 17th, and mail
> >> >> it back.
>
> >> > So you don't know how many people will be living in your house on
> >> > April 1?
>
> >> That is impossible to know.
>
> > You're incapable of saying how many people will be living in your
> > house in ten days?
> > Do you think that acting stupid is proving anything, boycott bob?
>
> Do you believe that no one in the USA will die
> or change residence between March 15th and
> April 1st?-

How many people will be living in YOUR house, boycott bob, on April 1?
Will YOU change residence? Will YOU give birth? Will YOU marry? Will
YOU adopt children?
That's "impossible to know"? Are you on drugs?

As for people dying... that's part of the +/- percentage.... as in any
census. Or should we have a census every tenth of a second for each
person dying...

Gee, boycott bob, do you really enjoy being called a fucking moron?
Obviously, yes.