client side custom validator
<p>I am trying to do client side custom validation. I have the following code in my aspx page, but I keep getting an error saying</p>

<blockquote>
  <p>System.Web.HttpException (0x80004005): Control 'chkList_Counts'
  referenced by the ControlToValidate property of 'validationCheck'
  cannot be validated. at
  System.Web.UI.WebControls.BaseValidator.CheckControlValidationProperty(String
  name, String propertyName) at
  System.Web.UI.WebControls.CustomValidator.ControlPropertiesValid() at
  System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) at
  System.Web.UI.Control.PreRenderRecursiveInternal() at</p>
</blockquote>

<p>I cannot even see my page. I get the error right away before the page displays.</p>

<p>Below is my code</p>

<pre><code>   &lt;div&gt; 
          &lt;asp:Panel ID="panel3" runat="server" CssClass="cis_edit_pnl" 
              GroupingText="Counts" Width="1240px"&gt; 
              &lt;asp:CheckBoxList ID="chkList_Counts" runat="server" 
                   RepeatDirection="Horizontal" 
                   RepeatColumns="3" Width="1060px"&gt; 
              &lt;/asp:CheckBoxList&gt; 
               &lt;asp:CustomValidator ID="validationCheck" runat="server" ControlToValidate="chkList_Counts" ClientValidationFunction="check_checkBoxList" EnableClientScript="true" ErrorMessage="At least one of the check boxes should be checked"&gt; 
                &lt;/asp:CustomValidator&gt; 
         &lt;/asp:Panel&gt; 
  &lt;/div&gt;
</code></pre>

<p>and my javascript function is like this</p>

<pre><code>    function check_checkBoxList(sender, args) { 
        debugger; 
        if (check_Counts() == false) { 
            args.IsValid = false; 
            return; 
        } 
        args.IsValid = true; 
        return; 
    } 

 function check_casrepCounts() { 
        var control; 
        control = document.getElementById("&lt;%=chkList_Counts.ClientID %&gt;").getElementsByTagName("input"); 
        if (eval(control)) { 

            for (var i = 0; i &lt; control.length; i++) { 
                if (control[i].checked == true) 
                    return true; 
            } 
            return false; 
        } 
    }
</code></pre>

<p>Thanks in advance.</p>
