Page 256 - DCAP408_WEB_PROGRAMMING
P. 256
Web Programming
Notes Server.HTML Encode can be used to send text encoded so that the browser will not interpret
it as HTML.
<%=expression %> is equivalent to <% Response.Write (expression) %>.
Besides sending output to the client, Response can control how and when the output is sent
to the client. Output can be sent in two different ways: buffered or unbuffered. Unbuffered
output is sent immediately. Buffered output is not sent until the script is finished, or until
a special command is given to send it.
The buffer property is a Boolean property that determines whether the output of your ASP
is sent as it runs or it is stored until all the code is complete or the Flush method is called.
It is a Boolean property which means that it is set to true or false.
Suppose you have buffering turned on. As your script is executing, output is being sent to
the buffer. Calling Response.Clear causes that buffer to be wiped out. In case, you have a
page that you do not want to be viewed under a special set of circumstances, it can be used.
Like Response.Clear, Response.Flush flushes all the data from the system buffer. However,
Response.Flush first sends it to the client. This is useful Response.Clear, Response.Flush
produces an error message when buffering is turned off.
Response.End ends execution of the script. If buffering is turned on and there is any
buffered data, it is sent. Any statements after the Response.End are not carried out. This is
a more abrupt end than simply allowing the script to end on its own, and so should be
avoided if possible. It can be useful, though, when problems (such as bad data) are detected
to prevent them from making things worse.
There are HTML Web pages that are on the screen for just a few seconds and then suddenly
it takes you to another page. This can be done in many ways. One way is to use the META
tag and the other is with client-side scripting like JavaScript, using the window object.
Response.Redirect URL takes the user to the page URL. If it is within the same site, a
relative URL (such as “products/index.html”) will work. If it is a separate site, the full
address including http:// should be provided.
Cookies are a way for you to store nuggets of information on the visitor’s computer. You
can then use your code to retrieve the values stored on the visitor’s system at a later
time.You place the cookies on the visitor’s machine by using the cookies collection of the
Response object.
The proxy serves as a funnel for many computers making requests to the Internet. One of
the things proxy does is to store a cache of pages requested by all the users of the proxy. So
instead of retrieving the same page many times form the Internet, the proxy merely
returns the cached page to the person making the request.
The cache control property is your way of instructing the proxy to cache or not to cache.
HTML pages and graphics can be stored in the cache. Response has two properties that can
be used to determine how long an ASP page be cached.These two properties are
Response.Expires and Response.ExpiresAbsolute
10.6 Keywords
Buffer: This property can be use to indicate whether the page is buffered.
CacheControl: This property can be used to set whether a proxy server can cache the output
generated by asp or not.
Cookies: This value can be used to set the cookie value.
250 LOVELY PROFESSIONAL UNIVERSITY