I have the following validator control in my page.
<asp:CompareValidator ID="cvPatientDateOfBirth" runat="server"
ControlToValidate="txtPatientDateOfBirth"
ErrorMessage="Enter proper date.(DD/MM/YYYY)"
Font-Bold="True" Operator="GreaterThan" Display="Dynamic"
ValidationGroup="FirstPreview" CssClass="validatorMsg"
SetFocusOnError="True" ValueToCompare="1/1/1100" Type="Date" >
</asp:CompareValidator>
If I use both compare validator for date type check and regular expression validator for years(4digit) check, then "12/02/198" is showing error message for both the validators.
Can anyone please tell me how to do that?
Thanks.
You can use RegularExpressionValidator and set ValidationExpression
ValidationExpression = "\d{1,2}\/\d{1,2}/\d{4}"