RemoteAttribute Class

 

Provides an attribute that uses the jQuery validation plug-in remote validator.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy

System.Object
  System.Attribute
    System.ComponentModel.DataAnnotations.ValidationAttribute
      System.Web.Mvc.RemoteAttribute

Syntax

[AttributeUsageAttribute(AttributeTargets.Property)]
public class RemoteAttribute : ValidationAttribute, IClientValidatable
[AttributeUsageAttribute(AttributeTargets::Property)]
public ref class RemoteAttribute : ValidationAttribute, IClientValidatable
[<AttributeUsageAttribute(AttributeTargets.Property)>]
type RemoteAttribute = 
    class
        inherit ValidationAttribute
        interface IClientValidatable
    end
<AttributeUsageAttribute(AttributeTargets.Property)>
Public Class RemoteAttribute
    Inherits ValidationAttribute
    Implements IClientValidatable

Constructors

Name Description
System_CAPS_protmethod RemoteAttribute()

Initializes a new instance of the RemoteAttribute class.

System_CAPS_pubmethod RemoteAttribute(String)

Initializes a new instance of the RemoteAttribute class using the specified route name.

System_CAPS_pubmethod RemoteAttribute(String, String)

Initializes a new instance of the RemoteAttribute class using the specified action-method name and controller name.

System_CAPS_pubmethod RemoteAttribute(String, String, AreaReference)

Initializes a new instance of the RemoteAttribute class.

System_CAPS_pubmethod RemoteAttribute(String, String, String)

Initializes a new instance of the RemoteAttribute class using the specified action-method name, controller name, and area name.

Properties

Name Description
System_CAPS_pubproperty AdditionalFields

Gets or sets the additional fields that are required for validation.

System_CAPS_pubproperty ErrorMessage

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty ErrorMessageResourceName

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty ErrorMessageResourceType

(Inherited from ValidationAttribute.)

System_CAPS_protproperty ErrorMessageString

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty HttpMethod

Gets or sets the HTTP method used for remote validation.

System_CAPS_pubproperty RequiresValidationContext

(Inherited from ValidationAttribute.)

System_CAPS_protproperty RouteData

Gets the route data dictionary.

System_CAPS_protproperty RouteName

Gets or sets the route name.

System_CAPS_protproperty Routes

Gets the route collection from the route table.

System_CAPS_pubproperty TypeId

(Inherited from Attribute.)

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Attribute.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod FormatAdditionalFieldsForClientValidation(String)

Returns a comma-delimited string of validation field names.

System_CAPS_pubmethod FormatErrorMessage(String)

Formats the error message that is displayed when validation fails.(Overrides ValidationAttribute.FormatErrorMessage(String).)

System_CAPS_pubmethodSystem_CAPS_static FormatPropertyForClientValidation(String)

Formats the property for client validation by prepending an asterisk (*) and a dot.

System_CAPS_pubmethod GetClientValidationRules(ModelMetadata, ControllerContext)

Gets a list of client validation rules for the property.

System_CAPS_pubmethod GetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod GetUrl(ControllerContext)

Gets the URL for the remote validation call.

System_CAPS_pubmethod GetValidationResult(Object, ValidationContext)

(Inherited from ValidationAttribute.)

System_CAPS_pubmethod IsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethod IsValid(Object)

This method always returns true.(Overrides ValidationAttribute.IsValid(Object).)

System_CAPS_protmethod IsValid(Object, ValidationContext)

(Inherited from ValidationAttribute.)

System_CAPS_pubmethod Match(Object)

(Inherited from Attribute.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod Validate(Object, String)

(Inherited from ValidationAttribute.)

System_CAPS_pubmethod Validate(Object, ValidationContext)

(Inherited from ValidationAttribute.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

(Inherited from Attribute.)

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

System.Web.Mvc Namespace

Return to top