Example #1
0
        /// <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;
        }
Example #2
0
        /// <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;
        }
Example #3
0
        /// <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);
        }
Example #4
0
		/// <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;
		}
Example #5
0
		/// <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;
		}
Example #6
0
		/// <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;
		}