<html>
 <head>
 <title>第七例 HtmlForm和HtmlGenericControl控件使用</title>
 
    <script language="VB" runat="server">
 
       Sub Button1_OnClick(Source as Object, e as EventArgs) 
	  Body.Attributes("bgcolor") = ColorSelect.Value
          Span1.InnerHtml="你点击的是按钮1，背景颜色改变为:"+ColorSelect.Value
          Span2.InnerHtml=""
          Span3.InnerHtml=""
       End Sub

       Sub Button2_OnClick(Source as Object, e as EventArgs) 
	  Body.Attributes("bgcolor") = ColorSelect.Value
          Span1.InnerHtml=""
          Span2.InnerHtml="你点击的是按钮2，背景颜色改变为:"+ColorSelect.Value
          Span3.InnerHtml=""
       End Sub
 
       Sub Button3_OnClick(Source as Object, e as EventArgs) 
	  Body.Attributes("bgcolor") = ColorSelect.Value
          Span1.InnerHtml=""
          Span2.InnerHtml=""
          Span3.InnerHtml="你点击的是按钮3，背景颜色改变为:"+ColorSelect.Value
       End Sub
 
    </script>
 
 </head>
 <blockquote>
 <body id=Body runat=server>
 
    <h3><font face="Verdana">HtmlForm及HtmlGenericControl实例</font></h3>
 
    <form id="ServerForm" runat="server">

    选择一种背景颜色：
    <p>
       <select id="ColorSelect" runat="server">
           <option>White</option>
           <option>LightBlue</option>
	   <option Selected>Gray</option>
	   <option>Green</option>
           <option>LightGreen</option>
           <option>Yellow</option>
	   <option>Red</option>
       </select>
    </p>
    
       <button id="Button1"
               OnServerClick="Button1_OnClick" 
               runat="server">
 
          按钮1
 
       </button>
 
       &nbsp;&nbsp;
 
       <span id="Span1" runat="server"/>
 
       <p>
 
       <button id="Button2"
               OnServerClick="Button2_OnClick" 
               runat="server">
       
          按钮2
 
       </button>
 
       &nbsp;&nbsp;
 
       <span id="Span2" runat="server"/>
 
       <p>
 
       <button id="Button3" 
               OnServerClick="Button3_OnClick"
               runat="server">
 
          按钮3
 
       </button>
 
       &nbsp;&nbsp;
 
       <span id="Span3" runat="server"/>
 
    </form>
 </blockquote>
 </body>
 </html>