internal static FormValue<bool> GetFormValue( bool isChecked, Control checkBox ) { return new FormValue<bool>( () => isChecked, () => checkBox.IsOnPage() ? checkBox.UniqueID : "", v => v.ToString(), rawValue => rawValue == null ? PostBackValueValidationResult<bool>.CreateValidWithValue( false ) : rawValue == "on" ? PostBackValueValidationResult<bool>.CreateValidWithValue( true ) : PostBackValueValidationResult<bool>.CreateInvalid() ); }