Expand Minimize

Page.Response Property

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.

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

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Response As HttpResponse

Property Value

Type: System.Web.HttpResponse
The current HttpResponse associated with the page.

ExceptionCondition
HttpException

The HttpResponse object is not available.

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)
   

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft