RegularExpressionAttribute.FormatErrorMessage(String) RegularExpressionAttribute.FormatErrorMessage(String) RegularExpressionAttribute.FormatErrorMessage(String) RegularExpressionAttribute.FormatErrorMessage(String) Method

Definition

Formats the error message to display if the regular expression validation fails.

public:
 override System::String ^ FormatErrorMessage(System::String ^ name);
public override string FormatErrorMessage (string name);
override this.FormatErrorMessage : string -> string
Public Overrides Function FormatErrorMessage (name As String) As String

Parameters

name
String String String String

The name of the field that caused the validation failure.

Returns

The formatted error message.

Exceptions

Remarks

The FormatErrorMessage creates the error message by using the name of the data field that caused the validation failure. You can override this method in custom validation attributes to customize how errors are created or to provide a more complex message that contains parameters that you evaluate at run time.

Applies to