DataAnnotationsModelValidator<TAttribute> 類別

定義

提供指定驗證類型的模型驗證程式。

public class DataAnnotationsModelValidator<TAttribute> : System.Web.Mvc.DataAnnotationsModelValidator where TAttribute : ValidationAttribute
type DataAnnotationsModelValidator<'Attribute (requires 'Attribute :> ValidationAttribute)> = class
    inherit DataAnnotationsModelValidator
Public Class DataAnnotationsModelValidator(Of TAttribute)
Inherits DataAnnotationsModelValidator

類型參數

TAttribute
繼承
DataAnnotationsModelValidator<TAttribute>
衍生

建構函式

DataAnnotationsModelValidator<TAttribute>(ModelMetadata, ControllerContext, TAttribute)

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

屬性

Attribute

從模型驗證程式取得驗證屬性。

ControllerContext

取得控制器內容。

(繼承來源 ModelValidator)
ErrorMessage

取得驗證失敗的錯誤訊息。

(繼承來源 DataAnnotationsModelValidator)
IsRequired

取得值,這個值表示是否需要模型驗證。

(繼承來源 DataAnnotationsModelValidator)
Metadata

取得模型驗證程式的中繼資料。

(繼承來源 ModelValidator)

方法

GetClientValidationRules()

擷取用戶端驗證規則集合。

(繼承來源 DataAnnotationsModelValidator)
Validate(Object)

傳回模型的驗證錯誤訊息清單。

(繼承來源 DataAnnotationsModelValidator)

適用於