Bewerken

Delen via


HttpRequestValidationException Constructors

Definition

Overloaded. Creates a new instance of the HttpRequestValidationException class.

Overloads

HttpRequestValidationException()

Creates a new instance of the HttpRequestValidationException class.

HttpRequestValidationException(String)

Creates a new HttpRequestValidationException exception with the specified error message.

HttpRequestValidationException(String, Exception)

Initializes a new instance of the HttpRequestValidationException class with a specified error message and a reference to the inner exception that is the cause of the exception.

HttpRequestValidationException()

Creates a new instance of the HttpRequestValidationException class.

public:
 HttpRequestValidationException();
public HttpRequestValidationException ();
Public Sub New ()

Applies to

HttpRequestValidationException(String)

Creates a new HttpRequestValidationException exception with the specified error message.

public:
 HttpRequestValidationException(System::String ^ message);
public HttpRequestValidationException (string message);
new System.Web.HttpRequestValidationException : string -> System.Web.HttpRequestValidationException
Public Sub New (message As String)

Parameters

message
String

A string that describes the error.

Remarks

The content of the message parameter is intended to be human readable. The caller of the HttpRequestValidationException(String) constructor is required to ensure that the message string has been localized.

Applies to

HttpRequestValidationException(String, Exception)

Initializes a new instance of the HttpRequestValidationException class with a specified error message and a reference to the inner exception that is the cause of the exception.

public:
 HttpRequestValidationException(System::String ^ message, Exception ^ innerException);
public HttpRequestValidationException (string message, Exception innerException);
new System.Web.HttpRequestValidationException : string * Exception -> System.Web.HttpRequestValidationException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

An error message that explains the reason for the exception.

innerException
Exception

The exception that is the cause of the current exception. If this parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the HttpRequestValidationException(String, Exception) constructor, or null if the InnerException property does not supply the inner exception value to the HttpRequestValidationException(String, Exception) constructor.

Applies to