title: CompareValidator inside an UpdatePanel - VS2008
body: <p>I'm using an UpdatePanel and want to put a CompareValidator on two text boxes, to verify that the user-entered password and confirmation are the same.</p>
  
  <p>This is working fine (I have VS2008 and am using .NET 3.5) out of the box, with one minor problem:</p>
  
  <p>The validation is firing as soon as the user clicks out of the first textbox, before they get a chance to type into the second.  This isn't causing any REAL problems, programmatically (all that happens is the error message shows, it goes away when they type in the confirmation) but our testers say it is a problem.  It won't pass UA testing until the validation doesn't fire until they click 'Save'.</p>
  
  <p>How do I get the CompareValidator to not fire until they've enterred text into both boxes?</p>
  
  <p>EDIT:</p>
  
  <p>Here's an example of the markup.</p>
  
  <pre><code>    &lt;div&gt;
          &lt;div&gt;&lt;asp:Label runat="server" ID="lblPassword" Text="Password"/&gt;&lt;/div&gt;
          &lt;div&gt;&lt;asp:TextBox runat="server" TextMode="password" ID="txtPassword" size="25" /&gt;&lt;/div&gt;    
      &lt;/div&gt;
      &lt;div&gt;
          &lt;div&gt;&lt;asp:Label runat="server" ID="lblConfirmPassword" Text="Confirm Password"/&gt;&lt;/div&gt;
          &lt;div&gt;&lt;asp:TextBox runat="server" TextMode="password" ID="txtConfirmPassword" size="25" /&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;asp:CompareValidator ID="CompareValidator1" ValidationGroup="PublishPassValidation" ControlToValidate="txtPassword" ControlToCompare="txtConfirmPassword" runat="server" ErrorMessage="Passwords do not match"&gt;&lt;/asp:CompareValidator&gt;
  </code></pre>
  
  <p>The above is within a control contained within the ContentTemplate of an UpdatePanel on a page.</p>
  
  <p>(CSS classes and styles removed for brevity)</p>