CustomValidator with server side validation only
<p>I have a following problem:</p>

<p>There are many validators on Page, all of them besides one have both client side and server side validation. One of them has only server side validation.</p>

<p>The problem:</p>

<p>My Page is being posted even some of client side validation are invalid. I think it should first validate client side and when everything is ok then it should check for server side.</p>

<p>Code:</p>

<p>Js part:</p>

<pre><code>        var hash = {
            '.jpg'  : 1,
            '.jpeg' : 1,
            '.bmp' : 1,
            '.png' : 1
        };
        function FileExtension(obj, args) {
            var file = '&lt;%=UploadFoto_FileUpload.ClientID %&gt;';
            var re = /\..+$/i;
            var ext = $("#" + file).val().match(re);
            if (ext != undefined) {
                ext = ext.toLowerCase();
                if (hash[ext]) {
                    args.IsValid = true;
                } else {
                    args.IsValid = false;
                }
            }
            else {
                args.IsValid = false;
            }
        }
        function Validator2(obj, args){
            args.IsValid = true;
        }
</code></pre>

<p>asp.net part:</p>

<pre><code>                &lt;asp:CustomValidator ID="UploadFoto_FileUpload_CustomValidator1" ErrorMessage="Ext error" ClientValidationFunction="FileExtension" OnServerValidate="UploadFoto_FileUpload_CustomValidator1_ServerValidate" Display="Dynamic" runat="server" /&gt;
                &lt;asp:CustomValidator ID="UploadFoto_FileUpload_CustomValidator2" ErrorMessage="De foto is te groot (maximaal 6mb)" ClientValidationFunction="Validator2" OnServerValidate="UploadFoto_FileUpload_CustomValidator2_ServerValidate" Display="Dynamic" runat="server" /&gt;

                &lt;asp:FileUpload ID="UploadFoto_FileUpload" CssClass="uploadField" runat="server" /&gt;

                &lt;asp:ImageButton ID="Submit_ImageButton" ImageUrl="../Images/btn-verzenden.png" AlternateText="Verzenden" CssClass="verzendenBtn" OnClick="Submit_ImageButton_Click" runat="server" /&gt; 
</code></pre>

<p>After some further test i've found that if there is even only first of them - UploadFoto_FileUpload_CustomValidator1 there is the same scenario:</p>

<p>when upload filed is empty then Ext error is displayed and page is not being posted</p>

<p>when file is chosen but ext is wrong then Ext error is displayed and page is not being posted</p>

<p>when file with correct ext is chosen then error message is not displayed but form is being posted even there are other validators with errors</p>
