This documentation is archived and is not being maintained.

HttpResponse.StatusDescription Property

Gets or sets the HTTP status string of the output returned to the client.

[Visual Basic]
Public Property StatusDescription As String
[C#]
public string StatusDescription {get; set;}
[C++]
public: __property String* get_StatusDescription();
public: __property void set_StatusDescription(String*);
[JScript]
public function get StatusDescription() : String;
public function set StatusDescription(String);

Property Value

A string describing the status of the HTTP output returned to the client. The default value is "OK".

Exceptions

Exception Type Condition
HttpException StatusDescription is set after the HTTP headers have been sent.

Example

The following example takes action if the status code is not "OK".

[Visual Basic] 
If Response.StatusDescription <> "OK" Then
    '...
 End If
    

[C#] 
if (Response.StatusDescription != "OK") 
 {
   // ...
 }
    

[C++] 
if (!Response->StatusDescription->Equals(S"OK")) 
 {
   // ...
 }
    

[JScript] 
if(Response.StatusDescription != "OK"){
  //...
}
  

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpResponse Class | HttpResponse Members | System.Web Namespace

Show: