[ Team LiB ] |
Chapter 17. The HttpResponse ClassJust as the HttpRequest class covered in Chapter 16 is the replacement for the classic ASP intrinsic Request object, the HttpResponse class is ASP.NET's replacement for ASP's intrinsic Response object. Like the HttpRequest class, the HttpResponse class instance for a given ASP.NET page is exposed as a property (the Response property) of the Page class (from which all pages are derived), so code for the HttpResponse class is the same as in classic ASP. For those of you with classic ASP applications that migrate to ASP.NET, this class will save you a lot of work. The HttpResponse class controls a variety of factors related to ASP.NET's response to a given HTTP request and provides access to the output stream of the response, allowing the writing of text or binary content to the client browser programmatically. The HttpResponse class provides access to this functionality through its properties, collections, and methods, which are shown in Table 17-1. The control over page output that the HttpResponse class provides includes the character set used and encoding of the response, as well as whether the response is buffered and sent all at once (the default) or sent as output is processed. Methods of the HttpResponse class provide granular control over output sent to the browser, including sending binary or text content and sending HTTP headers and cookies to the client. Note that several properties and methods exposed by the Response object in classic ASP have been deprecated in ASP.NET in favor of new properties and methods exposed by the HttpResponse class (or, in some cases, by other functionality available in ASP.NET). For properties and methods that have been deprecated and/or replaced by new members in ASP.NET, that fact will be notated in the "Notes" section of the reference for that property or method.
|
[ Team LiB ] |