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