CompareAttribute Class
Provides an attribute that compares two properties of a model.
System.Object
System.Attribute
System.ComponentModel.DataAnnotations.ValidationAttribute
System.Web.Mvc.CompareAttribute
System.Attribute
System.ComponentModel.DataAnnotations.ValidationAttribute
System.Web.Mvc.CompareAttribute
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
The CompareAttribute type exposes the following members.
| 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. |
![]() | TypeId | (Inherited from Attribute.) |
| Name | Description | |
|---|---|---|
![]() | Equals | (Inherited from Attribute.) |
![]() | Finalize | (Inherited from Object.) |
![]() | FormatErrorMessage | Applies formatting to an error message based on the data field where the compare error occurred. (Overrides ValidationAttribute.FormatErrorMessage(String).) |
![]() ![]() | FormatPropertyForClientValidation | Formats the property for client validation by prepending an asterisk (*) and a dot. |
![]() | GetClientValidationRules | Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. |
![]() | GetHashCode | (Inherited from Attribute.) |
![]() | GetType | (Inherited from Object.) |
![]() | GetValidationResult | (Inherited from ValidationAttribute.) |
![]() | IsDefaultAttribute | (Inherited from Attribute.) |
![]() | IsValid(Object) | (Inherited from ValidationAttribute.) |
![]() | IsValid(Object, ValidationContext) | Determines whether the specified object is equal to the compared object. (Overrides ValidationAttribute.IsValid(Object, ValidationContext).) |
![]() | Match | (Inherited from Attribute.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
![]() | Validate(Object, String) | (Inherited from ValidationAttribute.) |
![]() | Validate(Object, ValidationContext) | (Inherited from ValidationAttribute.) |
Show:
