Page 247 - DCAP408_WEB_PROGRAMMING
P. 247
Mandeep Kaur, Lovely Professional University Unit 10: Working with Response Object
Unit 10: Working with Response Object Notes
CONTENTS
Objectives
Introduction
10.1 Response Object
10.2 Response.Write
10.3 Response.Buffer
10.4 Cookies
10.5 Summary
10.6 Keywords
10.7 Review Questions
10.8 Further Readings
Objectives
After studying this unit, you will be able to:
Recognize Response object
Describe Response.Write
Demonstrate the Response.Buffer
Explain Cookies
Introduction
This unit will familiarize you with the one of the built in ASP objects, the Response object used
for sending output which might be text, cookie data etc to the user from the Server. It has several
methods and properties. Through its methods and properties you will learn how the output to
be sent to the user can be controlled. Using the cache control property you can instruct the proxy
whether to cache or not to cache.
10.1 Response Object
The response object is one of the five built-in ASP objects. Response is used to send output to the
client. This output might be text displayed in a browser window, cookie data or it might have to
do with how your pages are sent to the client and stored. For example, users might be at a form-
based page on our site that is a quiz. Users select the answer to the question from a list of
possible answers that are in an Option drop-down list. The name of the Option list is “answer”.
Once visitors select an answer, they hit the SUBMIT button. This action sends the answer that
they have selected to our .asp page, which will respond to their choice with this code:
If Request. Form (“answer”) = “42” then
Response. Write “you got the correct answers!”
LOVELY PROFESSIONAL UNIVERSITY 241