Name
Response
Synopsis
HttpResponse = Page.Response
Returns
an instance of the
HttpResponse
class that stores information about the
response and allows us to send HTTP response data to a browser.
It’s the equivalent of the ASP intrinsic Response
object. For information on the HttpResponse class,
see Chapter 17.
Parameters
-
HttpResponse An object of type HttpResponse that receives the instance of the
HttpResponseclass.
Example
The following example uses the Response property of the page object
to set the ContentType property of the
HttpResponse class to text/xml.
Setting this property will result in the output of the page being
displayed as XML markup in Internet Explorer 5.0 or above.
Sub Page_Load( )
Response.ContentType = "text/xml"
Message.Text = "This page will be displayed as XML in " & _
"Internet Explorer 5.0 or above."
End SubNotes
As with the Application and Cache properties, while you can retrieve a local reference to the HttpResponse instance associated with the request, it is more common to access this instance directly through the Request property, as shown in this example.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access