This documentation is archived and is not being maintained.
ValidationAttribute::ErrorMessage Property
Visual Studio 2008
Gets or sets an error message to associate with a validation control if a validation fails.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | If a ValidationAttribute is already in resource mode or if you try to reset this property multiple times. |
| ArgumentException | If the value of the error message is an empty string or nullptr. |
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.
Show: