ModelStateDictionary.IsValidField Method
Determines whether there are any ModelError objects that are associated with or prefixed with the specified key.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
Public Function IsValidField ( _
key As String _
) As Boolean
public bool IsValidField(
string key
)
public:
bool IsValidField(
String^ key
)
Parameters
- key
Type: System.String
The key.
Return Value
Type: System.Boolean
true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The key parameter is null reference (Nothing in Visual Basic). |