<html>
<head>
<title>Applying HtmlGenericControl Styles Dynamically</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void setColor ( object src, EventArgs e ) {
Body.Attributes [ "bgcolor" ] = colorSelect.Value;
}
</script>
</head>
<body id="Body" runat="server">
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Applying <span style="color:maroon">HtmlGenericControl</span> Styles Dynamically</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p>Select a background color for the page: </p>
<select id="colorSelect" runat="server">
<option>Aqua</option>
<option>Bisque</option>
<option>Chartreuse</option>
<option>DodgerBlue</option>
<option>ForestGreen</option>
<option>Gainsboro</option>
<option>HotPink</option>
<option>Ivory</option>
<option>Khaki</option>
<option>Lavender</option>
<option>Magenta</option>
<option>NavajoWhite</option>
<option>Olive</option>
<option>PaleGoldenRod</option>
<option>Red</option>
<option>SandyBrown</option>
<option>Tan</option>
<option>Violet</option>
<option>Wheat</option>
<option>YellowGreen</option>
</select>
<input type=submit runat="server" Value="Apply" onServerClick="setColor">
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>