RemoteAttributeBase 類別

定義

ValidationAttribute 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的端點應該會傳回 JSON,指出此值是否有效。

public ref class RemoteAttributeBase abstract : System::ComponentModel::DataAnnotations::ValidationAttribute, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::IClientModelValidator
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public abstract class RemoteAttributeBase : System.ComponentModel.DataAnnotations.ValidationAttribute, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IClientModelValidator
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type RemoteAttributeBase = class
    inherit ValidationAttribute
    interface IClientModelValidator
Public MustInherit Class RemoteAttributeBase
Inherits ValidationAttribute
Implements IClientModelValidator
繼承
RemoteAttributeBase
衍生
屬性
實作

備註

不會對最終表單提交進行伺服器端驗證。

建構函式

RemoteAttributeBase()

初始化 的新實例 RemoteAttributeBase

屬性

AdditionalFields

取得或設定用戶端應該包含在驗證要求中的逗號分隔功能變數名稱。

HttpMethod

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

RouteData

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

方法

AddValidation(ClientModelValidationContext)

將 Unobtrusive 驗證 HTML 屬性新增至 ClientModelValidationContext

FormatAdditionalFieldsForClientValidation(String)

格式化 propertyAdditionalFields 以用於產生的 HTML。

FormatErrorMessage(String)

ValidationAttribute 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的端點應該會傳回 JSON,指出此值是否有效。

FormatPropertyForClientValidation(String)

用於所產生 HTML 的格式 property

GetUrl(ClientModelValidationContext)

傳回用戶端應該傳送驗證要求的 URL。

IsValid(Object)

ValidationAttribute 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的端點應該會傳回 JSON,指出此值是否有效。

適用於