private void OnValidatingAddress(AddressValidatingEventArgs e) { if (ValidatingAddress != null) { ValidatingAddress(this, e); errInvalid.SetError(this.ValidateButton, e.ErrorMessage); } }
private void HomeAddress_ValidatingAddress(object sender, AddressValidatingEventArgs e) { // do some simple field validation, if there was more complex validation to be done we could // offload this work to the controller that could call some domain object to do some validation for us if (HomeAddress.Address.Street.Trim().Length == 0) { e.AddressIsValid = false; e.ErrorMessage = "Please enter a valid home address"; } else { e.AddressIsValid = true; } }