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

Q

Quentin Huo

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>
-----------------------------------------------------------------
 
C

Cowboy \(Gregory A. Beamer\)

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!
*************************************************
 
Q

Quentin Huo

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
 
P

Patrice

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

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top