ASP 101 - Active Server Pages 101 colors.aspx
<%@ Page Language="VB" %>
<script language="VB" runat="server">
	Sub Page_Load(sender as Object, e as EventArgs)
		If Not Page.IsPostBack Then
			' Default BG color to white to match the way it
			' looks when the page first loads.
			back_red.Value = "FF"
			back_green.Value = "FF"
			back_blue.Value = "FF"
		End If
	End Sub
	Sub Colorize_Click(sender as Object, e as EventArgs)
		Dim strTextColor As String
		Dim strBackColor As String
		strTextColor = "#" & text_red.Value & text_green.Value & text_blue.Value
		strBackColor = "#" & back_red.Value & back_green.Value & back_blue.Value
		spanColoredText.Style("color") = strTextColor
		spanColoredText.Style("background-color") = strBackColor
	End Sub
</script>
<html>
<head>
  <title>ASP.NET Colors Sample</title>
</head>
<body>
<p>
<span id="spanColoredText" runat="server"
	style="font-weight: bold;
		font-size: x-large;
		font-family: Arial, Verdana, Helvetica, Sans-Serif;"
>
	What color would you like today?
</span>
</p>
<form runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
	<td> </td>
	<td align="center">Red</td>
	<td align="center">Green</td>
	<td align="center">Blue</td>
</tr>
<tr>
	<td>Text Color:</td>
	<td>
		<select id="text_red" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
	<td>
		<select id="text_green" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
	<td>
		<select id="text_blue" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
</tr>
<tr>
	<td>Background Color:</td>
	<td>
		<select id="back_red" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
	<td>
		<select id="back_green" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
	<td>
		<select id="back_blue" runat="server">
			<option>00</option><option>33</option><option>66</option>
			<option>99</option><option>CC</option><option>FF</option>
		</select>
	</td>
</tr>
</table>
<input type="button" Value="Colorize Me!"
	OnServerClick="Colorize_Click" runat="server" />
</form>
<hr />
<p>
Click <a href="http://www.asp101.com/samples/colors_aspx.asp">here</a> to read about and download the source code.
</p>
</body>
</html>