<html>
<head>
<title>Modifying the Appearance of an HtmlButton Control</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void saySomething ( object src, EventArgs e ) {
switch ( ( ( HtmlButton ) src ) .ID ) {
case "Button1" :
msg.InnerHtml = "Say something amusing here when the button with the image is clicked";
break;
case "Button2" :
msg.InnerHtml = "Same here when the button with the rollover effect is clicked";
break;
}
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Modifying the Appearance of an <span class="hilite">HtmlButton</span> Control</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p>With embedded <<code>img</code>> tag: </p>
<p><button id="Button1" runat="server"
style="width:157; height=200"
onServerClick="saySomething">
<img src="/shared/images/billg_tongue.gif"
width="157" height="200" border=0 alt="">
</button>
<p>With rollover effect: </p>
<p><button id="Button2" runat="server"
onServerClick="saySomething"
style="font: 13pt verdana; background-color:lightgreen;
border-color:black"
onMouseOver="this.style.backgroundColor='yellow'"
onMouseOut="this.style.backgroundColor='lightgreen'">
Click me too!
</button>
<p id="msg" runat="server" />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>