Table of Contents

Class ModelError

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents an error that occurs during model binding.

public class ModelError
Inheritance
ModelError
Inherited Members

Constructors

ModelError(Exception)

Initializes a new instance of the ModelError class by using the specified exception.

public ModelError(Exception exception)

Parameters

exception Exception

The exception.

Exceptions

ArgumentNullException

The exception parameter is null.

ModelError(Exception, string)

Initializes a new instance of the ModelError class by using the specified exception and error message.

public ModelError(Exception exception, string errorMessage)

Parameters

exception Exception

The exception.

errorMessage string

The error message.

Exceptions

ArgumentNullException

The exception parameter is null.

ModelError(string)

Initializes a new instance of the ModelError class by using the specified error message.

public ModelError(string errorMessage)

Parameters

errorMessage string

The error message.

Properties

ErrorMessage

Gets or sets the error message.

public string ErrorMessage { get; }

Property Value

string

The error message.

Exception

Gets or sets the exception object.

public Exception Exception { get; }

Property Value

Exception

The exception object.