Export (0) Print
Expand All

HttpContext.Response Property

Gets the HttpResponse object for the current HTTP response.

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

'Declaration
Public ReadOnly Property Response As HttpResponse

Property Value

Type: System.Web.HttpResponse
The HttpResponse for the current HTTP response.

ExceptionCondition
HttpException

The Web application is running under IIS 7 in Integrated mode.

The Response property provides programmatic access to the properties and methods of the HttpResponse class. Because ASP.NET pages contain a default reference to the System.Web namespace (which contains the HttpContext class), you can reference the members of HttpContext on an .aspx page without using the fully qualified class reference to HttpContext. For example, you can use Response.Write("some output") to write output to an HTTP output stream. However, if you want to use the members of HttpResponse from an ASP.NET code-behind module, you must include a reference to the System.Web namespace in the module and a fully qualified reference to the currently active request/response context and the class in System.Web that you want to use. For example, in a code-behind page you must specify the fully qualified name HttpContext.Current.Response.Write("some output").

TopicLocation
How to: Create an Asynchronous HTTP HandlerBuilding ASP .NET Web Applications
How to: Create an Asynchronous HTTP HandlerBuilding ASP .NET Web Applications

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft