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

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 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: