<html>
<title>第八例  HtmlImage和HtmlInputButton控件使用</title>
 <head>
 
    <script language="C#" runat="server">

	void SubmitBtn_Click(Object Source, EventArgs E) 
	{
       if ((Name.Value == "cm") && (Password.Value == "991"))
		
		{
		Message.InnerHtml = "恭喜您，帐号、密码输入正确!";
		Image1.Src = "image1.gif";
	       	Image1.Height = 45;
        	Image1.Width = 45;
	        Image1.Border = 2;
        	Image1.Align = "left";
	        Image1.Alt = "图片 1";
		}
         else
		{
        	Message.InnerHtml = "帐号和密码错误，请您检查您的输入!";
		Image1.Src = "image2.gif";
    		Image1.Height = 45;
	        Image1.Width = 45;
        	Image1.Border = 5;
	        Image1.Align = "right";
        	Image1.Alt = "图片 2";
		}
        
     	 }

      void ResetBtn_Click(Object Source, EventArgs E)
       {
	  Name.Value = "";
         Password.Value = "";
      }

  
  </script>
 
 </head>
 
 <body>

    <form runat="server">
       <h3><font face="Verdana">第八例  HtmlImage和HtmlInputButton控件使用</font></h3>
            <center> 
   <blockquote>
	输入您的用户名: 
         	<input id="Name" 
                    type=text size=40 runat="server"> 
        <BR>
	<BR>     
	输入您的密  码:
		<input id="Password" 
                    type=password size=40 runat="server"> 
		<BR>
		<BR>
               <input type=submit value="确认输入"
                    OnServerClick="SubmitBtn_Click" runat="server">
             <input type=reset value="重新输入"
                    OnServerClick="ResetBtn_Click" runat="server">
             <h1>
             <span id="Message" runat="server"> </span> 
             </h1>
  
       </center>
       
       <br><br>
      <img id ="Image1"
            Src="image3.gif"
            Width="290"
            Height="60"
            Alt="Image 1"
            Border="1"
            Align="center" 
            runat=server/>
	<br>
  </blockquote> 	  
    </form>

 </body>
 </html>