I want to fire custom validation for complex log inspite of having empty value in the field
<p>I have a requirement in asp.net, that either email id or mobile has to be entered &amp; I have custom validator on server side to check for duplicate. My problem is when I keep email id &amp; mobile id blank it's not firing my custom validator(which is as per microsoft design). If I am putting requiredfield validator for email &amp; phone it mandates the user to enter both of them which I don't want. Is there any way I can achieve my requirement. </p>

<p>Here is my custom validator code:</p>

<pre><code>protected void EmailCheckValidation_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (txtEmail.Text.Trim() == "" || txtMobile.Text.Trim() == "")
            {
                args.IsValid = false;
                return;
            }
            args.IsValid = !DatabaseManager.DALHelper.IsEmailExists(txtEmail.Text);
        }
</code></pre>
