CompareAttribute Class
Note: This API is now obsolete.Namespace:
System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Return to top
Provides an attribute that compares two properties of a model.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
System::Object
System::Attribute
System.ComponentModel.DataAnnotations::ValidationAttribute
System.Web.Mvc::CompareAttribute
System::Attribute
System.ComponentModel.DataAnnotations::ValidationAttribute
System.Web.Mvc::CompareAttribute
[ObsoleteAttribute("The recommended alternative is to use the System.ComponentModel.DataAnnotations.CompareAttribute type, which has the same functionality as this type.")] [AttributeUsageAttribute(AttributeTargets::Property)] public ref class CompareAttribute : ValidationAttribute, IClientValidatable
| Name | Description | |
|---|---|---|
![]() | CompareAttribute(String^) | Initializes a new instance of the CompareAttribute class. |
| Name | Description | |
|---|---|---|
![]() | ErrorMessage | (Inherited from ValidationAttribute.) |
![]() | ErrorMessageResourceName | (Inherited from ValidationAttribute.) |
![]() | ErrorMessageResourceType | (Inherited from ValidationAttribute.) |
![]() | ErrorMessageString | (Inherited from ValidationAttribute.) |
![]() | OtherProperty | Gets the property to compare with the current property. |
![]() | OtherPropertyDisplayName | Gets the other properties display name. |
![]() | RequiresValidationContext | (Inherited from ValidationAttribute.) |
![]() | TypeId | (Inherited from Attribute.) |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute::GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:






