
  <body>
      <form id="form1" runat="server">
      <div>
          登录密码：<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
          <br />
          确认密码：<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
          <br />
          <asp:【CompareValidator】 ID="CompareValidator1" 【runat】="server" 【ControlToCompare】="TextBox1"
              【ControlToValidate】="TextBox2" 【ErrorMessage】="CompareValidator">输入的密码不一样！</asp:CompareValidator><br />
          <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="提交" />
      
      </div>
      </form>
  </body>
  </html>
  

--答案--
   ControlToValidate   CompareValidator   runat   ControlToCompare   ErrorMessage