"response" Object - Sending Data to Client

This section provides a tutorial example on how to use the 'response' object provided by the ASP programming interface to send data to the client, the Web browser.

The "response" object is also a rich object. It contains all the information the server wants to send to the browser, and methods to manage that information:

The following ASP page gives you an idea how to use the response object and its buffer mechanism.

<script language="vbscript" runat="server">
'  response_buffer_test.asp
'  Copyright (c) 2002 by Dr. Herong Yang
'  This program shows how to use the buffer in the response object
'
   response.write("<html><body>")
   response.write("<b>Tests on the response object</b>:</br>")
   response.Buffer = true
   response.write("Text line 1.<br/>")
   response.Clear()
   response.write("Text line 2.<br/>")
   response.End()
   response.write("Text line 3.<br/>")
   response.write("</body></html>")   
</script>

Output:

Text line 2.

As you can see from the output, the first text line was cleared out from the response buffer by the call to Clear(). The call to End() stopped the Web server to put any more text to the output. This was why the output only had the second text line.

Table of Contents

 About This Book

 ASP (Active Server Pages) Introduction

 IIS (Internet Information Services) 5.0

 MS Script Debugger

 VBScript Language

ASP Built-in Run-time Objects

 Introduction of ASP Objects

 "request" Object - Receiving Data from Client

"response" Object - Sending Data to Client

 "server" Object - Sharing Data across Applications

 "application" Object - Sharing Data within an Application

 "session" Object - Sharing Data across ASP Pages

 ASP Session

 Creating and Managing Cookies

 Managing Sessions with and without Cookies

 scrrun.dll - Scripting Runtime DLL

 Managing Response Header Lines

 Calculation Speed and Response Time

 ADO (ActiveX Data Object) DLL

 Working with MS Access Database

 Guest Book Application Example

 References

 Full Version in PDF/EPUB