共用方式為


ModelStateDictionary.GetValidationState(String) 方法

定義

ModelValidationState 回 的 key

public:
 Microsoft::AspNetCore::Mvc::ModelBinding::ModelValidationState GetValidationState(System::String ^ key);
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState GetValidationState (string key);
member this.GetValidationState : string -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState
Public Function GetValidationState (key As String) As ModelValidationState

參數

key
String

查詢模型狀態錯誤的索引鍵。

傳回

Unvalidated如果找不到指定索引鍵的專案,則傳回 ,如果找到有一或多個模型狀態錯誤的實例, Invalid 則傳回 , Valid 否則為 。

適用於