ModelStateDictionary.IsValidField Method (String)

.NET Framework (current version)
 

Determines whether there are any ModelError objects that are associated with the specified key or that are prefixed with the specified key.

Namespace:   System.Web.ModelBinding
Assembly:  System.Web (in System.Web.dll)

Public Function IsValidField (
	key As String
) As Boolean

Parameters

key
Type: System.String

The key.

Return Value

Type: System.Boolean

true if any ModelError objects are associated with the specified key or prefixed with the specified key; otherwise, false. If the key is not found in the dictionary, this method returns true.

Exception Condition
ArgumentNullException

The key parameter is null.

.NET Framework
Available since 4.5
Return to top
Show: