title: ASP.NET Custom Validator Client side & Server Side validation not firing
body: <p>This has not happened to me before, but for some reason both the client and server side validation events are not being triggered:</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBoxDTownCity" runat="server" CssClass="contactfield" /&gt;
  &lt;asp:CustomValidator ID="CustomValidator2" runat="server" EnableClientScript="true"
      ErrorMessage="Delivery Town or City required"
      ClientValidationFunction="TextBoxDTownCityClient" 
      ControlToValidate="TextBoxDTownCity"
      OnServerValidate="TextBoxDTownCity_Validate" Display="Dynamic" &gt;
  &lt;/asp:CustomValidator&gt;
  </code></pre>
  
  <p>Server-side validation event:</p>
  
  <pre><code>protected void TextBoxDTownCity_Validate(object source, ServerValidateEventArgs args)
  {
      args.IsValid = false;
  }
  </code></pre>
  
  <p>Client-side validation event:</p>
  
  <pre><code>function TextBoxDCountyClient(sender, args) {
      args.IsValid = false;
      alert("test");
  }
  </code></pre>
  
  <p>I thought at the least the Server Side validation would fire but no.  this has never happened to me before.  This has really got me stumped.</p>
  
  <p>I looked at the output and ASP.NET is recognizing the client side function:</p>
  
  <p>ASP.NET JavaScript output:</p>
  
  <pre><code>var ctl00_ctl00_content_content_CustomValidator2 = document.all ? document.all["ctl00_ctl00_content_content_CustomValidator2"] : document.getElementById("ctl00_ctl00_content_content_CustomValidator2");
  
  ctl00_ctl00_content_content_CustomValidator2.controltovalidate = "ctl00_ctl00_content_content_TextBoxDTownCity";
  
  ctl00_ctl00_content_content_CustomValidator2.errormessage = "Delivery Town or City required";
  
  ctl00_ctl00_content_content_CustomValidator2.display = "Dynamic";
  
  ctl00_ctl00_content_content_CustomValidator2.evaluationfunction = "CustomValidatorEvaluateIsValid";
  
  ctl00_ctl00_content_content_CustomValidator2.clientvalidationfunction = "TextBoxDTownCityClient";
  </code></pre>
  
  <p>Rendered custom validator:</p>
  
  <pre><code>&lt;span id="ctl00_ctl00_content_content_CustomValidator2" style="color:Red;display:none;"&gt;Delivery Town or City required&lt;/span&gt; 
  </code></pre>
  
  <p>Can any one shed some light as to why both client and server side validation would not be firing.</p>
  
  <p><strong>Edit: Typo I pasted in the wrong function, problem still the same</strong></p>
  
  <p>Just another update to the last comment: where by the TextBox cannot be empty.  I tested this out and it is not true.  On a blank page the CustomValidator fired my client side validation function fine without a value:</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" /&gt;
  &lt;asp:CustomValidator ID="CustomValidator1" runat="server" 
  ErrorMessage="CustomValidator" ClientValidationFunction="TextBoxDAddress1Client"&gt;&lt;/asp:CustomValidator&gt;
  &lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&gt;
  </code></pre>