Property Description
Buffer Whether to buffer the output or not. When the output is
buffered, the server will hold back the response until all of
the
server scripts have been processed, or until the script calls
the
Flush or End method. If this property is set, it should be
before
the <html> tag in the .asp file
CacheControl Sets whether proxy servers can cache the output or
not. When
this property is set to Public, the output can be cached by a
proxy server
Charset(charset_name) Sets the name of the character set
(like "ISO8859-1") to the
content type header
ContentType Sets the HTTP content type. Some common content
types are
"text/html", "image/gif", "image/jpeg", "text/plain". The
default is
"text/html"
Expires Sets how long a page will be cached on a browser before
it
expires
ExpiresAbsolute Sets a date and time when a page cached on a
browser will
expire
IsClientConnected Check to see if the client is still connected
to the server
Pics(pics_label) Adds a value to the pics label response
header.
Status Specifies the value of the status line. You can change
the status
line with this property
Method Description
AddHeader(name, value) Adds an HTML header with a
specified value
AppendToLog string Adds a string to the end of the server
log entry
BinaryWrite(data_to_write) Writes the given information
without any character-set
conversion.
Clear Clears the buffered output. Use this method to handle
errors. If
the Response.Buffer is not set to true, this method will cause a
run-time error
End Stops processing the script, and return the current result
Flush Sends buffered output immediately. If the Response.Buffer
is
not set to true, this method will cause a run-time error
Redirect(url) Redirects the user to another url
Write(data_to_write) Writes a text to the user
Example
1.Write Text
Codeing
<html>
<body>
<%
response.write("Hello World!")
%>
</body>
</html>
Output
Hello World!
2.Text and Html Tags
Codeing
<html>
<body>
<%
response.write("<h2>Hello World!<br>This sentence uses HTML tags
to format the text!</h2>")
%>
</body>
</html>
Output
Hello World!
This sentence uses HTML tags to format the text!
3.Redirect the User
Codeing
<%
if Request.Form("select")<>"" then
Response.Redirect(Request.Form("select"))
end if
%>
<html>
<body>
<form action="demo_redirect.asp" method="post">
<input type="radio" name="select"
value="demo_server.asp">
Server Example<br>
<input type="radio" name="select"
value="demo_text.asp">
Text Example<br><br>
<input type="submit" value="Go!">
</form>
</body>
</html>
4.Controlling the Buffer
Codeing
<%
Response.Buffer=true
%>
<html>
<body>
<p>I write some text, but I will control when the text will be
sent to the browser.</p>
<p>The text is not sent yet. I hold it back!</p>
<p>OK, let it go!</p>
<%
Response.Flush
%>
</body>
</html>
Output
I write some text, but I will control when the text will be sent
to the browser.
The text is not sent yet. I hold it back!
OK, let it go!
5.Clear the Buffer
Codeing
<%
Response.Buffer=true
%>
<html>
<body>
<p>This is some text I want to send to the user.</p>
<p>No, I changed my mind. I want to clear the text.</p>
<%
Response.Clear
%>
</body>
</html>
6.End a script in the middle of the processing
Codeing
<html>
<body>
<p>I am writing some text. This text wil never be<br>
<%
Response.End
%>
finished! It's too late to write more!</p>
</body>
</html>
Output
I am writing some text. This text wil never be
7.Expires
Codeing
<%Response.Expires=0%>
<html>
<body>
<p>This page will be refreshed with each access!</p>
</body>
</html>
Output
This page will be refreshed with each access!
8.ExpiresAbsolute
Codeing
<%
Response.ExpiresAbsolute=#May 05,2000 05:30:30#
%>
<html>
<body>
<p>This page will expire on May 05, 2000 05:30:30!</p>
</body>
</html>
Output
This page will expire on May 05, 2000 05:30:30!
9.isClientConnected
Codeing
<html>
<body>
<%
If Response.IsClientConnected=true then
Response.Write("The user is still connected!")
else
Response.Write("The user is not connected!")
end if
%>
</body>
</html>
Output
The user is still connected!
10.content type
Codeing
<%
Response.ContentType="text/html"
%>
<html>
<body>
<p>This is some text</p>
</body>
</html>
Output
This is some text
11.char set
Codeing
<%
Response.Charset="ISO8859-1"
%>
<html>
<body>
<p>This is some text</p>
</body>
</html>
Output
This is some text