title: ASP.NET Web-forms custom validator not firing
body: <p>I have a custom validator on my page for a file upload control.</p>
  
  <pre><code>&lt;asp:FileUpload ID="fuVendorBrief" runat="server" /&gt;
  &lt;br /&gt;
  &lt;asp:CustomValidator ID="cvVendorBriefFile" Display="Dynamic" runat="server" ValidationGroup="EditorValidate" ControlToValidate="fuVendorBrief" OnServerValidate="cvVendorBriefFile_ServerValidate" ErrorMessage="You must upload a vendor brief PDF file."&gt;     
  &lt;/asp:CustomValidator&gt;
  </code></pre>
  
  <p>I then also have a button.</p>
  
  <pre><code>&lt;asp:Button ID="btnSubmit" ValidationGroup="EditorValidate" OnClick="btnSubmit_Click" runat="server" Text="Add Vendor Brief" /&gt;
  </code></pre>
  
  <p>I have defined my custom validator event like so...</p>
  
  <pre><code>protected void cvVendorBriefFile_ServerValidate(object source, ServerValidateEventArgs args)
  {
      CustomValidator fileUploadValidator = (CustomValidator)source;
      FileUpload vendorBriefFileUpload = (FileUpload)fileUploadValidator.Parent.FindControl(fileUploadValidator.ControlToValidate);
      args.IsValid = vendorBriefFileUpload.HasFile &amp;&amp; vendorBriefFileUpload.FileName.ToLower().EndsWith(".pdf");
  }
  </code></pre>
  
  <p>This custom validator isn't even getting fired. Everything looks alright to me. If I drop a breakpoint anywhere in the server validation event it does not get hit when I click submit. I can hit breakpoints in the submit button's click event however.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT</strong> - I have other validation controls, like required field validators, on the page and they fire just fine.</p>
  
  <p><strong>EDIT 2</strong> - If you want the full source of the page and its codebehind then follow these links:</p>
  
  <ul>
  <li><a href="http://pastebin.com/wzqs566f" rel="nofollow noreferrer">ASPX</a></li>
  <li><a href="http://pastebin.com/ADpQ8Sc0" rel="nofollow noreferrer">CS</a></li>
  </ul>