Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

How do I validate multiple controls with the same Validator?

I have a validator like the one below. Right now it's only validating one control, but there are many controls on the page with the same validation criteria. How do I assign it to multiple controls? Do I really need to duplicate the validator?

                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                    ErrorMessage="Only alphanumeric  values are allowed for page names."
                    Display="None"
                    ControlToValidate="TextBoxCreatePage"
                    ValidationExpression="^[a-zA-Z][a-zA-Z0-9_]+$"
                    SetFocusOnError="True" />
ASKER CERTIFIED SOLUTION
Avatar of zkeown
zkeown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial