Response
Object
|
The
Response Object is used
to send output to the user
from the server.
Syntax
Response.collection
Response.property
Response.method |
Response
Object Properties
|
Property |
Description |
Buffer |
Buffers
the character stream sent
to the browser until page
processing completes. You
must turn buffering on to
issue any commands that
write header values, such
as Response.Redirect. Accepts
values of either True
or False |
Cache
Control |
Controls
whether proxy servers can
cache the page. Page-caching
by browsers and proxies
is a problem with ASP, because
your server never receives
a request if the page is
loaded from cache - defeating
the purpose of ASP, which
is to provide dynamic pages
on demand. Accepts values
of "Private" and
"Public". The
values are Strings and the
quotes are required. |
Charset(charset_name) |
Controls
the character set the browser
should use the render the
page. The default is ISO-LATIN-1.
For example, to change the
character set to ISO-LATIN-7,
use <% Response.charset="ISO-LATIN-7"
%> |
Content
Type |
Sets
a header value that specifies
what type of content the
page contain. The default
value is text/html. You
may need to change this,
particularly if you use
the Response.BinaryWrite
method to send binary data.
|
Expires |
Sets
the time interval, in minutes,
before the page expires.
Until the specified interval
elapses, the browser may
re-display the page from
cache. After the specified
time, the browser must return
to the server to re-display
the page. |
ExpiresAbsolute |
Sets
an exact time when the page
expires. Before the specified
time, the browser may re-display
the page from cache. After
the specified time, the
browser must return to the
server to re-display the
page. |
IsClientConnected |
Before
you get excited about this
method, it doesn't do what
you might think. There's
no way to find out whether
a specific client is using
your application except
when a TCP/IP connection
is actually in effect. The
IsClientConnected method
is useful only for determining
whether you should continue
to process a script. For
example, if a page takes
a long time to respond,
you can use this method
to check whether the client
is still connected. If not,
there's no point in continuing
to process the script. Note
that the IsClientConnected
method does not tell you
which client is connected.
|
Pics(pics_label) |
Adds
an HTTP header value containing
a Platform for Internet
Content Selection (PICS)
label. The PICS lable contains
a rating for the page. Using
this system, parents can
determine the levels of
content that their children
can see. For more information,
see the PICS specification
on the W3C website: http://w3c.org
|
Status |
Sets
the value of the status
line returned by the server.
You may have seen this error
before - 404 Not Found.
You set the Status property
to return a specific number
and explanation to the browser.
The HTTP specification defines
the set of valid status
values and their meanings.
|
|
Response
Object Properties
|
Method |
Description |
AddHeader(name,
value) |
Adds
a header with a specified
value, for example, Response.AddHeader
"myheader", "myValue". |
AppendToLog |
Appends
a custom string to the end
of the current IIS log entry.
You can use this to write
special messages that you
may pick up later with a
log analysis tool. |
BinaryWrite(data_to_write) |
Used
to write non-textual data
to the browser. You can
use this method to send
image, audio, or other binary
to the browser. |
Clear |
Clears
the contents of the server
response buffer. If you
are in the middle of processing
a page and some condition
causes you to want to restart
the page, you can clear
the buffer (assuring you're
buffering the response)
by issuing the Response.Clear
command. |
End |
Ends
the response. This command
takes effect immediately.
The server will not process
any code or HTML that follows
the Response.End command. |
Flush |
Sends
any buffered content to
the browser. You might want
to do this for long pages.
Note that the Response.Flush
method raises an error if
you have not set the Response.Buffer
to true. |
Redirect(url) |
Sends
a header to the browser
telling it to request a
new page. You specify the
URL for the page along with
any QueryString variables
and values. |
Write(data_to_write) |
Writes
text and HTML content to
the browser. |
|
Response
Object Collection
|
Collection |
Properties |
Cookies(name) |
Use
the collection to write
both per-session and persistent
cookies to the client browser.
|
|
|
|
|