Gets the HttpResponse object associated with the Page object. This object allows you to send HTTP response data to a client and contains information about that response.
Assembly: System.Web (in System.Web.dll)
Syntax
<BrowsableAttribute(False)> _
Public ReadOnly Property Response As HttpResponse
Get[BrowsableAttribute(false)]
public HttpResponse Response { get; }[BrowsableAttribute(false)]
public:
property HttpResponse^ Response {
HttpResponse^ get ();
}[<BrowsableAttribute(false)>]
member Response : HttpResponse
Exceptions
| Exception | Condition |
|---|---|
| HttpException | The HttpResponse object is not available. |
Examples
The following code example demonstrates creating a cookie and adding it to the page's HTTP output by using the HttpResponse object.
Dim MyCookie As New HttpCookie("LastVisit")
Dim now As DateTime = DateTime.Now
MyCookie.Value = now.ToString()
MyCookie.Expires = now.AddHours(1)
Response.Cookies.Add(MyCookie)
HttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;
MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);
Response.Cookies.Add(MyCookie);
Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, 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.