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
Protected method RemoteAttribute() Initializes a new instance of the RemoteAttribute class.
Public method RemoteAttribute(String) Initializes a new instance of the RemoteAttribute class using the specified route name.
Public method RemoteAttribute(String, String) Initializes a new instance of the RemoteAttribute class using the specified action-method name and controller name.
Public method 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
Public property AdditionalFields Gets or sets the additional fields that are required for validation.
Public property ErrorMessage (Inherited from ValidationAttribute.)
Public property ErrorMessageResourceName (Inherited from ValidationAttribute.)
Public property ErrorMessageResourceType (Inherited from ValidationAttribute.)
Protected property ErrorMessageString (Inherited from ValidationAttribute.)
Public property HttpMethod Gets or sets the HTTP method used for remote validation.
Protected property RouteData Gets the route data dictionary.
Protected property RouteName Gets or sets the route name.
Protected property Routes Gets the route collection from the route table.
Public property TypeId (Inherited from Attribute.)

Top

Methods

  Name Description
Public method Equals (Inherited from Attribute.)
Protected method Finalize (Inherited from Object.)
Public method FormatAdditionalFieldsForClientValidation Returns a comma-delimited string of validation field names.
Public method FormatErrorMessage Formats the error message that is displayed when validation fails. (Overrides ValidationAttribute.FormatErrorMessage(String).)
Public methodStatic member FormatPropertyForClientValidation Formats the property for client validation by prepending an asterisk (*) and a dot.
Public method GetClientValidationRules Gets a list of client validation rules for the property.
Public method GetHashCode (Inherited from Attribute.)
Public method GetType (Inherited from Object.)
Protected method GetUrl Gets the URL for the remote validation call.
Public method GetValidationResult (Inherited from ValidationAttribute.)
Public method IsDefaultAttribute (Inherited from Attribute.)
Public method IsValid(Object) This method always returns true. (Overrides ValidationAttribute.IsValid(Object).)
Protected method IsValid(Object, ValidationContext) (Inherited from ValidationAttribute.)
Public method Match (Inherited from Attribute.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Public method Validate(Object, String) (Inherited from ValidationAttribute.)
Public method Validate(Object, ValidationContext) (Inherited from ValidationAttribute.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method _Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method _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.

See Also

Reference

System.Web.Mvc Namespace