<html>
<head>
<title>Responding to an HtmlInputButton Control Event</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void saySomething ( object src, EventArgs e ) {
switch ( ( ( HtmlInputButton ) src ) .ID ) {
case "Button1" :
msg.InnerHtml = "Say something amusing here when the default input type button is clicked";
break;
case "Button2" :
msg.InnerHtml = "Same here when the rollover input type button is clicked";
break;
}
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Responding to an <span class="hilite">HtmlInputButton Control</span> Event</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p>The default input type button look: </p>
<p><input type=button id="Button1" runat="server"
value="Click me!"
onServerClick="saySomething" />
<p>With rollover effect: </p>
<p><input type=button id="Button2" runat="server"
value="Click me too!"
onServerClick="saySomething"
style="font: 13pt verdana; background-color:lightgreen;
border-color:black; height=50; width:150"
onMouseOver="this.style.backgroundColor='yellow'"
onMouseOut="this.style.backgroundColor='lightgreen'" />
<p id="msg" runat="server" />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>