ValidationAttribute.FormatErrorMessage Method
Applies formatting to an error message based on the data field where the error occurred.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
'Declaration Public Overridable Function FormatErrorMessage ( _ name As String _ ) As String 'Usage Dim instance As ValidationAttribute Dim name As String Dim returnValue As String returnValue = instance.FormatErrorMessage(name)
Parameters
- name
- Type: System.String
The name of the data field where the error occurred.
This method formats an error message using the ErrorMessageString property. The error is evaluated every time this method is called. This method appends the name of the data field that triggered the error to the formatted error message to indicate the data field that triggered the error. You can customize how the error message is formatted by creating a derived class that overrides this method.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.