Bewerken

Share via


ValidationAttribute.FormatErrorMessage(String) Method

Definition

Applies formatting to an error message, based on the data field where the error occurred.

public:
 virtual System::String ^ FormatErrorMessage(System::String ^ name);
public virtual string FormatErrorMessage (string name);
abstract member FormatErrorMessage : string -> string
override this.FormatErrorMessage : string -> string
Public Overridable Function FormatErrorMessage (name As String) As String

Parameters

name
String

The name to include in the formatted message.

Returns

An instance of the formatted error message.

Exceptions

The current attribute is malformed.

Remarks

This method formats an error message by using the ErrorMessageString property. This method appends the name of the data field that triggered the error to the formatted error message. You can customize how the error message is formatted by creating a derived class that overrides this method.

Applies to