HttpResponse::SubStatusCode Property
Gets or sets a value qualifying the status code of the response.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| PlatformNotSupportedException | The operation requires the integrated pipeline mode in IIS 7.0 and at least the .NET Framework version 3.0. |
| HttpException | The status code is set after all HTTP headers have been sent. |
The SubStatusCode property is only supported with the integrated pipeline mode in IIS 7.0 and at least the .NET Framework version 3.0. When you set the SubStatusCode property, the status is logged on IIS 7.0 if failed-request tracing is configured. Independent of whether tracing is configured, the code is never sent as part of the final response to the request. For more information, see Troubleshooting Failed Requests Using Failed Request Tracing in IIS 7.0.
The following example sets the SubStatusCode property in an event handler for the HttpApplication instance of the PostAuthenticateRequest event. Put the code file in the App_Code folder of your Web application and configure the Web.config file to register the module. For more information, see Walkthrough: Creating and Registering a Custom HTTP Module.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.