title: asp.net CustomValidator never fires OnServerValidate
body: <p>I have the following ASP page:</p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="ShellContent" runat="server"&gt;
      &lt;form runat="server" id="AddNewNoteForm" method="post""&gt;
  
          &lt;fieldset id="NoteContainer"&gt;
              &lt;legend&gt;Add New Note&lt;/legend&gt;
              &lt;asp:ValidationSummary ID="ValidationSummary1" runat="server" /&gt;
              &lt;div class="ctrlHolder"&gt;
                  &lt;asp:Label ID="LabelNoteDate" runat="server" Text="Note Date" 
                      AssociatedControlID="NoteDateTextBox"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="NoteDateTextBox" runat="server" class="textInput" 
                      CausesValidation="True" &gt;&lt;/asp:TextBox&gt;
                  &lt;asp:CustomValidator 
                          ID="CustomValidator1" 
                          runat="server" 
                          ErrorMessage="CustomValidator" 
                          ControlToValidate="NoteDateTextBox" 
                          OnServerValidate="CustomValidator1_ServerValidate" 
                          Display="Dynamic" 
                          &gt;*&lt;/asp:CustomValidator&gt;
              &lt;/div&gt;
              &lt;div class="ctrlHolder"&gt;
                  &lt;asp:Label ID="LabelNoteText" AssociatedControlID="NoteTextTextBox" runat="server" Text="Note"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="NoteTextTextBox" runat="server" Height="102px" 
                      TextMode="MultiLine" class="textInput" &gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                      ErrorMessage="Note Text is Required" ControlToValidate="NoteTextTextBox"&gt;*&lt;/asp:RequiredFieldValidator&gt;   
  
              &lt;/div&gt;
              &lt;div class="buttonHolder"&gt;
                  &lt;asp:Button ID="OkButton" runat="server" Text="Add New Note"  
                      CssClass="primaryAction" onclick="OkButton_Click"/&gt;
                  &lt;asp:HyperLink ID="HyperLink1" runat="server"&gt;Cancel&lt;/asp:HyperLink&gt;
              &lt;/div&gt;
          &lt;/fieldset&gt;
      &lt;/form&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>and the following code behind for the CustomValidator1_ServerValidate() method:</p>
  
  <pre><code>    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
      {
  
          if (string.IsNullOrEmpty(args.Value.Trim()))
          {
              args.IsValid = false;
              CustomValidator1.ErrorMessage = "Note Date is Required!";
              return;
          }
  
          DateTime testDate;
          if (DateTime.TryParse(args.Value, out testDate))
          {
              args.IsValid = true;
              CustomValidator1.ErrorMessage = "Invalid Date!";
          }
  
      }
  </code></pre>
  
  <p>It never seems to fail validation no matter what I put in the text box...</p>
  
  <p>Should mention this is ASP.NET 2.0</p>