/// <summary> /// Raises the <see cref="Wilco.Web.UI.WebControls.CallbackValidator.ServerValidate"/> event. /// </summary> /// <param name="e"></param> /// <returns></returns> protected virtual void OnServerValidate(CallbackServerValidateEventArgs e) { CallbackServerValidateEventHandler handler = this.Events[CallbackValidator.EventServerValidate] as CallbackServerValidateEventHandler; if (handler != null) { handler(this, e); } this.errorMessageToUse = e.ErrorMessage; }
/// <summary> /// Executes the logic for the current callback. /// </summary> /// <param name="eventArgument"></param> public void RaiseCallbackEvent(string eventArgument) { CallbackServerValidateEventArgs args = new CallbackServerValidateEventArgs(eventArgument, true, this.ErrorMessage); this.OnServerValidate(args); if (args.IsValid) { args.ErrorMessage = String.Empty; } this.callbackResult = args.IsValid + "|" + args.ErrorMessage; }
/// <summary> /// Evaluates whether the control's input is valid. /// </summary> /// <returns></returns> protected override bool EvaluateIsValid() { string validationValue = String.Empty; string controlToValidate = this.ControlToValidate; if (controlToValidate.Length > 0) { validationValue = base.GetControlValidationValue(controlToValidate); if (((validationValue == null) || (validationValue.Trim().Length == 0)) && !this.ValidateEmptyText) { return(true); } } CallbackServerValidateEventArgs args = new CallbackServerValidateEventArgs(validationValue, true, this.ErrorMessage); this.OnServerValidate(args); return(args.IsValid); }
/// <summary> /// Raises the <see cref="Wilco.Web.UI.WebControls.CallbackValidator.ServerValidate"/> event. /// </summary> /// <param name="e"></param> /// <returns></returns> protected virtual void OnServerValidate(CallbackServerValidateEventArgs e) { CallbackServerValidateEventHandler handler = this.Events[CallbackValidator.EventServerValidate] as CallbackServerValidateEventHandler; if (handler != null) { handler(this, e); } this.errorMessageToUse = e.ErrorMessage; }
/// <summary> /// Executes the logic for the current callback. /// </summary> /// <param name="eventArgument"></param> public void RaiseCallbackEvent(string eventArgument) { CallbackServerValidateEventArgs args = new CallbackServerValidateEventArgs(eventArgument, true, this.ErrorMessage); this.OnServerValidate(args); if (args.IsValid) args.ErrorMessage = String.Empty; this.callbackResult = args.IsValid + "|" + args.ErrorMessage; }
/// <summary> /// Evaluates whether the control's input is valid. /// </summary> /// <returns></returns> protected override bool EvaluateIsValid() { string validationValue = String.Empty; string controlToValidate = this.ControlToValidate; if (controlToValidate.Length > 0) { validationValue = base.GetControlValidationValue(controlToValidate); if (((validationValue == null) || (validationValue.Trim().Length == 0)) && !this.ValidateEmptyText) { return true; } } CallbackServerValidateEventArgs args = new CallbackServerValidateEventArgs(validationValue, true, this.ErrorMessage); this.OnServerValidate(args); return args.IsValid; }