Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help, the simplest code doesn't work well, but where is the problem?

Reply
Thread Tools

Help, the simplest code doesn't work well, but where is the problem?

 
 
Quentin Huo
Guest
Posts: n/a
 
      10-04-2004
Hi:

When I tried the following code, I got an error:

if I clicked "Click me" button more than one time, and than click "back"
button in the IE browser Toolbar, I will get an error: "The page cannot be
displayed......".

But I won't get any error if I only click the "click me" button one time and
then click the browser's "Back" button.

In fact, this is an example from the Book "Essential ASP.NET with Examples
in C#" by Fritz Onion ( Listing 2-5). Please try this simplest code and tell
me if you get the same problem. What causes the problem? Maybe it is caused
by webserver setting?

Can anyone help me!

Q.

-----------------------------------------------------------------
<%@ Page Language="C#" %>

<html>
<script runat=server>
protected void OnClickMyButton(object src, EventArgs e)
{
_message.InnerText = "You clicked the button!";
}

protected void Page_Init(object src, EventArgs e)
{
_MyButton.ServerClick +=
new EventHandler(OnClickMyButton);
}
</script>
<body>
<form runat=server>

<h2>ASP.NET event page</h2>
<p>
<input type=button id=_MyButton
value="Click me!" runat=server />
</p>
<span id=_message runat=server/>
</form>
</body>
</html>
-----------------------------------------------------------------









 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-05-2004
The page is set to time out most likely. You should not be able to use the
back button on a form. There are nicer ways of telling the user, however.
Have not seen this particular book.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Quentin Huo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi:
>
> When I tried the following code, I got an error:
>
> if I clicked "Click me" button more than one time, and than click "back"
> button in the IE browser Toolbar, I will get an error: "The page cannot be
> displayed......".
>
> But I won't get any error if I only click the "click me" button one time
> and then click the browser's "Back" button.
>
> In fact, this is an example from the Book "Essential ASP.NET with Examples
> in C#" by Fritz Onion ( Listing 2-5). Please try this simplest code and
> tell me if you get the same problem. What causes the problem? Maybe it is
> caused by webserver setting?
>
> Can anyone help me!
>
> Q.
>
> -----------------------------------------------------------------
> <%@ Page Language="C#" %>
>
> <html>
> <script runat=server>
> protected void OnClickMyButton(object src, EventArgs e)
> {
> _message.InnerText = "You clicked the button!";
> }
>
> protected void Page_Init(object src, EventArgs e)
> {
> _MyButton.ServerClick +=
> new EventHandler(OnClickMyButton);
> }
> </script>
> <body>
> <form runat=server>
>
> <h2>ASP.NET event page</h2>
> <p>
> <input type=button id=_MyButton
> value="Click me!" runat=server />
> </p>
> <span id=_message runat=server/>
> </form>
> </body>
> </html>
> -----------------------------------------------------------------
>
>
>
>
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Quentin Huo
Guest
Posts: n/a
 
      10-05-2004
Hi:

Thank you!

I tried the same code in another machine, it works! No matter how many the
click times are, I can click "Back" button of the browser without getting
any error. So I think it should be a configuration issue.

And I checked the web.config file and the value of "timeout" in
<sessionState> is "20".

Where is the problem? Where can I check?

Qing


"Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> The page is set to time out most likely. You should not be able to use the
> back button on a form. There are nicer ways of telling the user, however.
> Have not seen this particular book.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> *************************************************
> Think outside the box!
> *************************************************
> "Quentin Huo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi:
>>
>> When I tried the following code, I got an error:
>>
>> if I clicked "Click me" button more than one time, and than click "back"
>> button in the IE browser Toolbar, I will get an error: "The page cannot
>> be displayed......".
>>
>> But I won't get any error if I only click the "click me" button one time
>> and then click the browser's "Back" button.
>>
>> In fact, this is an example from the Book "Essential ASP.NET with
>> Examples in C#" by Fritz Onion ( Listing 2-5). Please try this simplest
>> code and tell me if you get the same problem. What causes the problem?
>> Maybe it is caused by webserver setting?
>>
>> Can anyone help me!
>>
>> Q.
>>
>> -----------------------------------------------------------------
>> <%@ Page Language="C#" %>
>>
>> <html>
>> <script runat=server>
>> protected void OnClickMyButton(object src, EventArgs e)
>> {
>> _message.InnerText = "You clicked the button!";
>> }
>>
>> protected void Page_Init(object src, EventArgs e)
>> {
>> _MyButton.ServerClick +=
>> new EventHandler(OnClickMyButton);
>> }
>> </script>
>> <body>
>> <form runat=server>
>>
>> <h2>ASP.NET event page</h2>
>> <p>
>> <input type=button id=_MyButton
>> value="Click me!" runat=server />
>> </p>
>> <span id=_message runat=server/>
>> </form>
>> </body>
>> </html>
>> -----------------------------------------------------------------
>>
>>
>>
>>
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      10-05-2004
It looks more like a client side issue as you have a different effect on two
machines. Check perhaps the "cache settings" in IE.

Patrice

--

"Quentin Huo" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> Hi:
>
> Thank you!
>
> I tried the same code in another machine, it works! No matter how many the
> click times are, I can click "Back" button of the browser without getting
> any error. So I think it should be a configuration issue.
>
> And I checked the web.config file and the value of "timeout" in
> <sessionState> is "20".
>
> Where is the problem? Where can I check?
>
> Qing
>
>
> "Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
> > The page is set to time out most likely. You should not be able to use

the
> > back button on a form. There are nicer ways of telling the user,

however.
> > Have not seen this particular book.
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > *************************************************
> > Think outside the box!
> > *************************************************
> > "Quentin Huo" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Hi:
> >>
> >> When I tried the following code, I got an error:
> >>
> >> if I clicked "Click me" button more than one time, and than click

"back"
> >> button in the IE browser Toolbar, I will get an error: "The page cannot
> >> be displayed......".
> >>
> >> But I won't get any error if I only click the "click me" button one

time
> >> and then click the browser's "Back" button.
> >>
> >> In fact, this is an example from the Book "Essential ASP.NET with
> >> Examples in C#" by Fritz Onion ( Listing 2-5). Please try this simplest
> >> code and tell me if you get the same problem. What causes the problem?
> >> Maybe it is caused by webserver setting?
> >>
> >> Can anyone help me!
> >>
> >> Q.
> >>
> >> -----------------------------------------------------------------
> >> <%@ Page Language="C#" %>
> >>
> >> <html>
> >> <script runat=server>
> >> protected void OnClickMyButton(object src, EventArgs e)
> >> {
> >> _message.InnerText = "You clicked the button!";
> >> }
> >>
> >> protected void Page_Init(object src, EventArgs e)
> >> {
> >> _MyButton.ServerClick +=
> >> new EventHandler(OnClickMyButton);
> >> }
> >> </script>
> >> <body>
> >> <form runat=server>
> >>
> >> <h2>ASP.NET event page</h2>
> >> <p>
> >> <input type=button id=_MyButton
> >> value="Click me!" runat=server />
> >> </p>
> >> <span id=_message runat=server/>
> >> </form>
> >> </body>
> >> </html>
> >> -----------------------------------------------------------------
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplest solution for wireless adsl access Ramesh Wireless Networking 1 02-24-2006 08:06 AM
Re: easiest, simplest QA tool? Winrunner? Bob ASP .Net 0 04-28-2004 01:54 PM
Simplest QoS for VoIP Mimmus Cisco 6 12-05-2003 08:54 AM
simplest way to password protect website with SQL Server Brent Burkart ASP .Net 5 10-16-2003 05:34 AM
can I do such a simplest counter in VHDL? walala VHDL 3 09-14-2003 08:05 PM



Advertisments