ModelStateDictionary.AddModelError Method (String, Exception)

.NET Framework (current version)
 

Adds a model error to the errors collection using the specified key and using the specified exception for the value.

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

Public Sub AddModelError (
	key As String,
	exception As Exception
)

Parameters

key
Type: System.String

The key.

exception
Type: System.Exception

The exception object.

Exception Condition
ArgumentNullException

The key parameter is null.

.NET Framework
Available since 4.5
Return to top
Show: