asp.net.ph

Response.StatusCode Property

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 );

Property Value

An Integer representing the status of the HTTP output returned to the client. The default value is 200 ( OK ).

Exceptions


Exception Type Condition
HttpException Occurs when StatusCode is set after the HTTP headers have been sent.

Example

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

if ( Response.StatusCode != 200 ) {
    // ... do whatever here ...
}
  C# VB

See Also

HttpResponse Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph