Using Request and Response

Team-Fly    

 
Visual Basic .NET Unleashed
By Paul Kimmel
Table of Contents
Chapter 19.  ASP.NET Web Programming

Using Request and Response

ASP.NET is a redesigned and re-engineered evolution of ASP. Several metaphors from ASP were carried over to ASP.NET (although their implementations might be vastly different). Two such objects are the Request and Response introduced in the System.Web.UI.UserControl class.

These objects also exist in the System.Web.UI.Page class. The Request object is an instance of the HttpRequest class, and the Response object is an instance of the HttpResponse class. Basically, Request represents the HTTP values sent by the client, and Response represents the information sent by the server application back to the client.

We use the Request and Response relative to the properties and methods their classes expose and their respective roles. When you need specific information about a client request in your code, get that information from the Request object. The parallel is true for the Response object. From Listing 19.1 it is apparent that we can use the Response.Write method to render HTML directly on the page (see line 26 of Listing 19.1).


Team-Fly    
Top
 


Visual BasicR. NET Unleashed
Visual BasicR. NET Unleashed
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 222

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net