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

取得或設定傳送驗證要求時,應該使用 HTTP 方法 ("Get""Post") 用戶端。

HttpMethod

取得或設定傳送驗證要求時,應該使用 HTTP 方法 ("Get""Post") 用戶端。

(繼承來源 RemoteAttributeBase)
RouteData

取得產生 RouteValueDictionary 用戶端應該傳送驗證要求的 URL 時使用的 。

RouteData

取得產生 RouteValueDictionary 用戶端應該傳送驗證要求的 URL 時使用的 。

(繼承來源 RemoteAttributeBase)
RouteName

取得或設定產生用戶端應該傳送驗證要求的 URL 時所使用的路由名稱。

方法

AddValidation(ClientModelValidationContext)

RemoteAttributeBase,用於設定非干擾驗證以將 Ajax 要求傳送至網站的控制器。 叫用的動作應該會傳回 JSON,指出值是否有效。

AddValidation(ClientModelValidationContext)

將 Unobtrusive 驗證 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)

適用於