Can I assign two validators to a text field? I used the regularexpression validator and the required identifier for the txtAccount text field, but only regularexpressionvalidator works when executed. I used this code:
<asp:RegularExpressionValidator ID="REV1" runat="server" ErrorMessage="should be a numeric value" ValidationExpression="\d*" ControlToValidate="txtAccount"> </asp:RegularExpressionValidator> <asp:RequiredFieldValidator ID="RFV1" runat="server" ErrorMessage="AC.No already exists" ControlToValidate="txtAccount"> </asp:RequiredFieldValidator>
Yes, you can assign two validators to one control; your problem is that your validators are kind of "mutually exclusive" and you think that only one of them shoots.
, , , , , "-" ; , "-" , , "-" . , , " -", , , , ! ?
, ValidationSummary.
. - , . , , . , . , . .