ModelStateDictionary.IsValidField Method
Determines whether any error messages are associated with the specified key.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function IsValidField ( _
key As String _
) As Boolean
'Usage
Dim instance As ModelStateDictionary
Dim key As String
Dim returnValue As Boolean
returnValue = instance.IsValidField(key)
public bool IsValidField(
string key
)
public:
bool IsValidField(
String^ key
)
member IsValidField :
key:string -> bool
public function IsValidField(
key : String
) : boolean
Parameters
- key
Type: System.String
The key.
Return Value
Type: System.Boolean
true if no error messages are associated with the specified key, or the specified key does not exist; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | key is null reference (Nothing in Visual Basic). |