Is it possible to assign Multiple Validation Groups to a single Validation Control?
22,795
What about using two RequiredFieldValidator objects, one for Group1 and one for Group2?
Comments
-
Ananth almost 2 years
I have a Form like this.
UserID has to be validated when user clicks "Check Availability" and "Submit"
Hence "UserID" required field validator has to be assigned two grops.
As if now it is assigned only Group1
<asp:RequiredFieldValidator ID="UserIDRequiredFieldValidator" runat="server" ErrorMessage="Enter UserID" ControlToValidate="txtUserID" ValidationGroup="Group1"></asp:RequiredFieldValidator>
So is it possible to assign "Group1" and "Group2" to UserIDRequiredFieldValidator
I have already gone through How to validate against Multiple validation groups? which talks about validating Group1 and Group2 when user clicks "Submit" which is a good alternate solution .
Thanks in Advance
-
Ananth about 13 yearsGood Solution.. Definitely solves the issue..But is it not possible to assign multiple groups to a validation control ?
-
Ásgeir Gunnar Stefánsson about 10 yearsNo it is not possible but you can call Page.Validate("groupOne"); Page.Validate("groupTwo"); from code behind.
-
user1566694 almost 6 yearsI thought multiple validation groups was primarily to solve the problem of using multiple required field validators. They like to all fire (on blur) instead of accepting one false result is enough.