public GetPostBackValue ( PostBackValueDictionary postBackValues ) : string | ||
postBackValues | PostBackValueDictionary | |
Résultat | string |
/// <summary> /// Validates and returns the duration, a secondary validation in case javascript is disabled on the client system. /// </summary> public TimeSpan ValidateAndGetPostBackDuration(PostBackValueDictionary postBackValues, Validator validator, ValidationErrorHandler validationErrorHandler) { if (tooLongOrInvalidCharacters(durationPicker.GetPostBackValue(postBackValues))) { validator.NoteErrorAndAddMessage("Please enter a valid duration."); return(TimeSpan.Zero); } return(validator.GetTimeSpan(validationErrorHandler, parseTimeSpan(durationPicker.GetPostBackValue(postBackValues)))); }
/// <summary> /// Validates the date and returns the nullable date. /// </summary> public DateTime?ValidateAndGetNullablePostBackDate( PostBackValueDictionary postBackValues, Validator validator, ValidationErrorHandler errorHandler, bool allowEmpty) { return(validator.GetNullableDateTime( errorHandler, textBox.GetPostBackValue(postBackValues).ToUpper(), DateTimeTools.MonthDayYearFormats.Select(i => i + " " + DateTimeTools.HourAndMinuteFormat).ToArray(), allowEmpty, min, max)); }
/// <summary> /// Validates the date and returns the nullable date. /// </summary> public DateTime?ValidateAndGetNullablePostBackDate( PostBackValueDictionary postBackValues, Validator validator, ValidationErrorHandler errorHandler, bool allowEmpty) { var date = validator.GetNullableDateTime(errorHandler, textBox.GetPostBackValue(postBackValues), null, allowEmpty, min, max); if (errorHandler.LastResult == ErrorCondition.NoError && date.HasTime()) { validator.NoteErrorAndAddMessage("Time information is not allowed."); } return(date); }
/// <summary> /// Validates the time and returns the nullable time. The value is expressed in time since 12AM on an arbitrary day. /// </summary> public TimeSpan?ValidateAndGetNullableTimeSpan( PostBackValueDictionary postBackValues, Validator validator, ValidationErrorHandler errorHandler, bool allowEmpty) { return(textBox != null ? validator.GetNullableTimeOfDayTimeSpan( errorHandler, textBox.GetPostBackValue( postBackValues ).ToUpper(), DateTimeTools.HourAndMinuteFormat.ToCollection().ToArray(), allowEmpty) : selectList.ValidateAndGetSelectedItemIdInPostBack(postBackValues, validator)); }
private Box test1( DataModification dm, Action<string> setValue ) { var box = new EwfTextBox( "" ); box.SetupAutoComplete( TestService.GetInfo(), AutoCompleteOption.NoPostBack ); var dv = new DataValue<string>(); dm.AddTopValidationMethod( ( pbvd, validator ) => dv.Value = box.GetPostBackValue( pbvd ) ); dm.AddModificationMethod( () => setValue( dv.Value ) ); return new Box( "Autofill behavior. Typing more than 3 characters should bring up autofill options from a web service. " + "Selecting an item or changing the text will no cause a post-back. This value show appear when submitting the page's submit button.", box.ToSingleElementArray() ); }