Export (0) Print
Expand All

HttpResponseMessageProperty.StatusCode Property

Gets or sets the status code of the current HTTP response to which this property is attached.

Namespace: System.ServiceModel.Channels
Assembly: System.ServiceModel (in system.servicemodel.dll)

public HttpStatusCode StatusCode { get; set; }
/** @property */
public HttpStatusCode get_StatusCode ()

/** @property */
public void set_StatusCode (HttpStatusCode value)

public function get StatusCode () : HttpStatusCode

public function set StatusCode (value : HttpStatusCode)

Not applicable.

Property Value

Returns the StatusCode to send on the HTTP response.

Exception typeCondition

ArgumentOutOfRangeException

The value is set to less than 100 or greater than 599.

This property has one of the values in the HttpStatusCode enumeration.

This shows how to get the StatusCode that is sent on the HTTP response:

HttpStatusCode httpStatusCode =
    responseProperty.StatusCode;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft