RemoteAttribute 類別

定義

提供屬性,這個屬性會使用 jQuery 驗證外掛程式遠端驗證程式。

[System.AttributeUsage(System.AttributeTargets.Property)]
public class RemoteAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute, System.Web.Mvc.IClientValidatable
type RemoteAttribute = class
    inherit ValidationAttribute
    interface IClientValidatable
Public Class RemoteAttribute
Inherits ValidationAttribute
Implements IClientValidatable
繼承
RemoteAttribute
屬性
實作

建構函式

RemoteAttribute()

初始化 RemoteAttribute 類別的新執行個體。

RemoteAttribute(String)

使用指定的路由名稱, RemoteAttribute 初始化 類別的新實例。

RemoteAttribute(String, String)

使用指定的動作方法名稱和控制器名稱, RemoteAttribute 初始化 類別的新實例。

RemoteAttribute(String, String, AreaReference)

初始化 RemoteAttribute 類別的新執行個體。

RemoteAttribute(String, String, String)

使用指定的動作方法名稱、控制器名稱和區功能變數名稱稱,初始化 類別的新實例 RemoteAttribute

屬性

AdditionalFields

取得或設定驗證所需的額外欄位。

HttpMethod

取得或設定遠端驗證所使用的 HTTP 方法。

RouteData

取得路由資料字典。

RouteName

取得或設定路由名稱。

Routes

取得來自路由表的路由集合。

方法

FormatAdditionalFieldsForClientValidation(String)

傳回驗證欄位名稱的逗號分隔字串。

FormatErrorMessage(String)

格式化在驗證失敗時所顯示的錯誤訊息。

FormatPropertyForClientValidation(String)

格式化用戶端驗證的屬性,方法是在前面加上星號 (*) 和點號。

GetClientValidationRules(ModelMetadata, ControllerContext)

取得屬性的用戶端驗證規則清單。

GetUrl(ControllerContext)

取得遠端驗證呼叫的 URL。

IsValid(Object)

這個方法永遠傳回 true。

適用於