I've try to extend SingleLineText field on WFFM on Sitecore. This field will have CustomValidator. But ServerValidate event does not fire when page postbacked. The snipped code below.
public class SingleLineText : Sitecore.Form.Web.UI.Controls.SingleLineText
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
var validator = new CustomValidator() { Display = ValidatorDisplay.None };
validator.ServerValidate += this.Validator_ServerValidate;
this.generalPanel.Controls.Add(validator);
}
protected void Validator_ServerValidate(object source, ServerValidateEventArgs args)
{
// does not fire
var validator = source as IValidator;
args.IsValid = this.IsValid(validator);
}
}
The same code works fine on ustom user control field which has ascx.