HttpException.GetHttpCode Method

Gets the HTTP response status code to return to the client.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public int GetHttpCode ()
public int GetHttpCode ()
public function GetHttpCode () : int
Not applicable.

Return Value

A non-zero HTTP code representing the exception or the InnerException code; otherwise, HTTP response status code 500.

If there is a non-zero HTTP code, it is returned. Otherwise, the InnerException code is returned. If neither an InnerException code nor a non-zero HTTP code is available, the HTTP response status code 500 is returned. For more information on HTTP response status codes, see the Status Code Definitions of the Hypertext Transfer Protocol - HTTP/1.1 on the World Wide Web Consortium (W3C) Web site.

Windows 98, Windows Server 2000 SP4, 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, 2.0, 1.1, 1.0

Community Additions

ADD
Show: