System.Web Namespace HttpResponse Class
Sets or retrieves the HTTP status code of the output returned to the client.
[ VB ]
Public Property StatusCode As Integer
[ C# ]
public int StatusCode {get; set;}
[ C++ ]
public: __property int get_StatusCode ( );
public: __property void set_StatusCode ( int );
[ JScript ]
public function get StatusCode ( ) : int;
public function set StatusCode ( int );
An Integer representing the status of the HTTP output returned to the client. The default value is 200 ( OK ).
Exception Type |
Condition |
HttpException |
Occurs when StatusCode is set after the HTTP headers have been sent. |
The following example takes action if the status code is not 200.
if ( Response.StatusCode != 200 ) {
// ... do whatever here ...
}
If Response.StatusCode <> 200 Then
' ... do whatever here ...
End If |
|
C# |
VB |
HttpResponse Members