Control ‘CheckBoxList1’ referenced by the ControlToValidate property of ‘RequiredFieldValidator1’ cannot be validated

New developers at least get this exception one time in life. The error is “Control ‘CheckBoxList1’ referenced by the ControlToValidate property of ‘RequiredFieldValidator1’ cannot be validated“. Here in this simple tip I will describe why this error occurred and how we can resolve this error.

Error Reason:
In Asp.Net we have a bundle of validator. RequiredFieldValidator is one of them and a more popular validator. To use the RequiredFieldValidator Control at first we assign ControlToValidate property for which we need to set the field as a required field. But if you assign a CheckBoxList in ControlToValidate property you got the exception.
ControlToValidate Error

Error Solution:
First of all we can not use RequiredFieldValidator for CheckBoxLIst. We have to use CustomValidator Control to reslove the issue. For the solution please go through my below article:

Client Side Javascript CheckBoxList Validation using Custom Validator in Asp.Net C# VB.Net

Hope your problem will be resolved. Happy coding!

Posted in .Net,, C#, VB.Net

Leave a Reply

Your email address will not be published. Required fields are marked *