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