args.IsValid
is of type bool
, and CustomValidators.UniqueReference
mustn't return a value of that type. Therefore,
args.IsValid = (CustomValidators.UniqueReference(BOQRefTextBox.Text));
won't work since you can't assign whatever the return value of UniqueReference
is to IsValid
.
Since UniqueReference
returns an ValidationResult
, it should probably look like this:
args.IsValid = (CustomValidators.UniqueReference(BOQRefTextBox.Text)).IsValid;