RemoteAttribute 类

定义

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

public ref class RemoteAttribute : System::ComponentModel::DataAnnotations::ValidationAttribute, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::IClientModelValidator
public ref class RemoteAttribute : Microsoft::AspNetCore::Mvc::RemoteAttributeBase
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class RemoteAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IClientModelValidator
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class RemoteAttribute : Microsoft.AspNetCore.Mvc.RemoteAttributeBase
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type RemoteAttribute = class
    inherit ValidationAttribute
    interface IClientModelValidator
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type RemoteAttribute = class
    inherit RemoteAttributeBase
Public Class RemoteAttribute
Inherits ValidationAttribute
Implements IClientModelValidator
Public Class RemoteAttribute
Inherits RemoteAttributeBase
继承
RemoteAttribute
继承
属性
实现

注解

不对最终表单提交执行服务器端验证。

构造函数

RemoteAttribute()

初始化 RemoteAttribute 类的新实例。

RemoteAttribute(String)

初始化 RemoteAttribute 类的新实例。

RemoteAttribute(String, String)

初始化 RemoteAttribute 类的新实例。

RemoteAttribute(String, String, String)

初始化 RemoteAttribute 类的新实例。

属性

AdditionalFields

获取或设置客户端应包含在验证请求中的字段的逗号分隔名称。

AdditionalFields

获取或设置客户端应包含在验证请求中的字段的逗号分隔名称。

(继承自 RemoteAttributeBase)
HttpMethod

获取或设置 ("Get""Post") 客户端在发送验证请求时应使用的 HTTP 方法。

HttpMethod

获取或设置 ("Get""Post") 客户端在发送验证请求时应使用的 HTTP 方法。

(继承自 RemoteAttributeBase)
RouteData

获取 RouteValueDictionary 在生成客户端应发送验证请求的 URL 时使用的 。

RouteData

获取 RouteValueDictionary 在生成客户端应发送验证请求的 URL 时使用的 。

(继承自 RemoteAttributeBase)
RouteName

获取或设置生成客户端应在其中发送验证请求的 URL 时使用的路由名称。

方法

AddValidation(ClientModelValidationContext)

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

AddValidation(ClientModelValidationContext)

将非侵入式验证 HTML 属性添加到 ClientModelValidationContext

(继承自 RemoteAttributeBase)
FormatAdditionalFieldsForClientValidation(String)

格式 propertyAdditionalFields ,用于生成的 HTML。

FormatAdditionalFieldsForClientValidation(String)

格式 propertyAdditionalFields ,用于生成的 HTML。

(继承自 RemoteAttributeBase)
FormatErrorMessage(String)

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

FormatErrorMessage(String)

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

(继承自 RemoteAttributeBase)
FormatPropertyForClientValidation(String)

在生成的 HTML 中使用的格式 property

GetUrl(ClientModelValidationContext)

返回客户端应在其中发送验证请求的 URL。

IsValid(Object)

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

IsValid(Object)

控制器的 , RemoteAttributeBase 用于配置不显眼验证以向网站发送 Ajax 请求。 调用的操作应返回指示值是否有效的 JSON。

(继承自 RemoteAttributeBase)

适用于