Page.Response Property
.NET Framework 2.0
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)
Assembly: System.Web (in system.web.dll)
The following code example demonstrates creating a cookie and adding it to the page's HTTP output by using the HttpResponse object.
HttpCookie myCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.get_Now();
myCookie.set_Value(now.ToString());
myCookie.set_Expires(now.AddHours(1));
get_Response().get_Cookies().Add(myCookie);
var myCookie : HttpCookie = new HttpCookie("LastVisit") var now : DateTime = DateTime.Now myCookie.Value = now.ToString() myCookie.Expires = now.AddHours(1) Response.Cookies.Add(myCookie)
Community Additions
ADD
Show: