I would use a CustomFieldValidator like this:
<asp:CustomValidator runat="server"
ID="MyCustomValidator"
ValidationGroup="YOUR_VALIDATION_GROUP_NAME"
OnServerValidate="MyCustomValidator_ServerValidate"
ErrorMessage="At least one textbox needs to be filled in." />
and then in your codebehind you have:
protected void MyCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
if (/* one of three textboxes has text*/)
args.IsValid = true;
else
args.IsValid = false;
}
You can also add a Client-side component to this validation, and make it sexy by extending it with AJAX toolkit's ValidatorCalloutExtender control.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…