RemoteAttribute Class
Provides an attribute that uses the jQuery validation plug-in remote validator.
Inheritance Hierarchy
System.Object
System.Attribute
System.ComponentModel.DataAnnotations.ValidationAttribute
System.Web.Mvc.RemoteAttribute
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
<AttributeUsageAttribute(AttributeTargets.Property)> _
Public Class RemoteAttribute _
Inherits ValidationAttribute _
Implements IClientValidatable
'Usage
Dim instance As RemoteAttribute
[AttributeUsageAttribute(AttributeTargets.Property)]
public class RemoteAttribute : ValidationAttribute,
IClientValidatable
[AttributeUsageAttribute(AttributeTargets::Property)]
public ref class RemoteAttribute : public ValidationAttribute,
IClientValidatable
public class RemoteAttribute extends ValidationAttribute implements IClientValidatable
The RemoteAttribute type exposes the following members.
Constructors
Name | Description | |
---|---|---|
RemoteAttribute() | Initializes a new instance of the RemoteAttribute class. | |
RemoteAttribute(String) | Initializes a new instance of the RemoteAttribute class using the specified route name. | |
RemoteAttribute(String, String) | Initializes a new instance of the RemoteAttribute class using the specified action-method name and controller name. | |
RemoteAttribute(String, String, String) | Initializes a new instance of the RemoteAttribute class using the specified action-method name, controller name, and area name. |
Top
Properties
Name | Description | |
---|---|---|
AdditionalFields | Gets or sets the additional fields that are required for validation. | |
ErrorMessage | (Inherited from ValidationAttribute.) | |
ErrorMessageResourceName | (Inherited from ValidationAttribute.) | |
ErrorMessageResourceType | (Inherited from ValidationAttribute.) | |
ErrorMessageString | (Inherited from ValidationAttribute.) | |
HttpMethod | Gets or sets the HTTP method used for remote validation. | |
RouteData | Gets the route data dictionary. | |
RouteName | Gets or sets the route name. | |
Routes | Gets the route collection from the route table. | |
TypeId | (Inherited from Attribute.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Attribute.) | |
Finalize | (Inherited from Object.) | |
FormatAdditionalFieldsForClientValidation | Returns a comma-delimited string of validation field names. | |
FormatErrorMessage | Formats the error message that is displayed when validation fails. (Overrides ValidationAttribute.FormatErrorMessage(String).) | |
FormatPropertyForClientValidation | Formats the property for client validation by prepending an asterisk (*) and a dot. | |
GetClientValidationRules | Gets a list of client validation rules for the property. | |
GetHashCode | (Inherited from Attribute.) | |
GetType | (Inherited from Object.) | |
GetUrl | Gets the URL for the remote validation call. | |
GetValidationResult | (Inherited from ValidationAttribute.) | |
IsDefaultAttribute | (Inherited from Attribute.) | |
IsValid(Object) | This method always returns true. (Overrides ValidationAttribute.IsValid(Object).) | |
IsValid(Object, ValidationContext) | (Inherited from ValidationAttribute.) | |
Match | (Inherited from Attribute.) | |
MemberwiseClone | (Inherited from Object.) | |
ToString | (Inherited from Object.) | |
Validate(Object, String) | (Inherited from ValidationAttribute.) | |
Validate(Object, ValidationContext) | (Inherited from ValidationAttribute.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
_Attribute.GetIDsOfNames | (Inherited from Attribute.) | |
_Attribute.GetTypeInfo | (Inherited from Attribute.) | |
_Attribute.GetTypeInfoCount | (Inherited from Attribute.) | |
_Attribute.Invoke | (Inherited from Attribute.) |
Top
Remarks
This attribute enables a client-side validation call to the server where the actual validation is performed. The client side version of this class is ModelClientValidationRemoteRule.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.