Table of Contents

Class HttpStatusCodeResult

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

Provides a way to return an action result with a specific HTTP response status code and description.

public class HttpStatusCodeResult : ActionResult
Inheritance
HttpStatusCodeResult
Derived
Inherited Members

Constructors

HttpStatusCodeResult(int)

Initializes a new instance of the HttpStatusCodeResult class using a status code.

public HttpStatusCodeResult(int statusCode)

Parameters

statusCode int

The status code.

HttpStatusCodeResult(int, string)

Initializes a new instance of the HttpStatusCodeResult class using a status code and status description.

public HttpStatusCodeResult(int statusCode, string statusDescription)

Parameters

statusCode int

The status code.

statusDescription string

The status description.

HttpStatusCodeResult(HttpStatusCode)

Initializes a new instance of the HttpStatusCodeResult class using a status code.

public HttpStatusCodeResult(HttpStatusCode statusCode)

Parameters

statusCode HttpStatusCode

The status code.

HttpStatusCodeResult(HttpStatusCode, string)

Initializes a new instance of the HttpStatusCodeResult class using a status code and status description.

public HttpStatusCodeResult(HttpStatusCode statusCode, string statusDescription)

Parameters

statusCode HttpStatusCode

The status code.

statusDescription string

The status description.

Properties

StatusCode

Gets the HTTP status code.

public int StatusCode { get; }

Property Value

int

The HTTP status code.

StatusDescription

Gets the HTTP status description.

public string StatusDescription { get; }

Property Value

string

the HTTP status description.

Methods

ExecuteResult(ControllerContext)

Enables processing of the result of an action method by a custom type that inherits from the ActionResult class.

public override void ExecuteResult(ControllerContext context)

Parameters

context ControllerContext

The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.