title: ASP.NET CustomValidator client side
body: <p>I can't get this CustomValidator working.</p>
  
  <p>In the &lt;head&gt;:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    function ValidateFile(sender, args){
        alert("Hi");
  
        args.IsValid = document.getElementById("fuFile").value != "" || 
                       document.getElementById("c101_c7").value != "";
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>In the body:</p>
  
  <pre><code>&lt;asp:FileUpload ID="fuFile" runat="server" size="70"/&gt;
  &lt;asp:TextBox ID="c101_c7" class="textbox" runat="server"/&gt;
  &lt;asp:CustomValidator ID="vldFile" runat="server" ClientValidationFunction="ValidateFile"
      ErrorMessage="You must either upload a file or provide a URL of a file."&gt;&lt;/asp:CustomValidator&gt;
  </code></pre>
  
  <p>What should be in the args.IsValid if either the FileUpload or TextBox has to be filled in?</p>