ModelStateDictionary.AddModelError Method (String, Exception)

Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key.

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

'Declaration
Public Sub AddModelError ( _
	key As String, _
	exception As Exception _
)
'Usage
Dim instance As ModelStateDictionary 
Dim key As String 
Dim exception As Exception

instance.AddModelError(key, exception)

Parameters

key
Type: System.String

The key.

exception
Type: System.Exception

The exception.

Show: