| To read the article online, visit http://www.4GuysFromRolla.com/webtech/faq/Beginner/faq3.shtml |
|
One of the most important objects in ASP is the Response object. It is
the object which communicates between the server and the output which is
sent to the client. To write an ASP page, all you need to do is write a
standard HTML page, putting in the Active Server Pages script where
needed. Active Server Pages script is denoted by the text between
To send ASP to the client, you need to use the Response object. The method of the Response object which sends data to the client is the Write method. For example, if you write an HTML page which looks like:
if a user views the page with a standard browser, they will see the text,
"Hello, World!" on the screen. It's as if you had just written an HTML
page with the words "Hello, World!" where the <%'s the text between
and the %>'s were. Of course, unlike an HTML page which is sent
directly to the client, this page has passed through the server's ASP.DLL,
parsing it so that instead of the client seeing
You can inherently invoke the As you notice, we just got rid of the Response.Write( ... ), but left the stuff in between. The = simulates Response.Write.
There are also a few other neat properties in the Response object. One is
Expires, which sets how soon your page expires. Many modern browsers
cache pages for quicker downloading times. You can use ASP to set how
often the browser checks to see if it needs to redownload the page. You
set it in terms on minutes. If you want to browser not to cache the page,
you can set Pretty neat, eh? Another neat property of the Response object is the Buffer property, which takes either a true or false value. If buffer is set to true, the server processes the entire ASP script before sending any of the file to the client. If buffering is set to false (which it is by default), the server will send data to the client as it processes it. Below is an example of setting buffering to true:
|
| Article Information | |
| Article Title: | The Response Object |
| Article Author: | Scott Mitchell |
| Article URL: | http://www.4GuysFromRolla.com/webtech/faq/Beginner/faq3.shtml |
Copyright 2010 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers