|
Response Object and HTML
Encoding
The response object is often used in
conjunction with various kinds of coding schemes. No discussion of response would be
complete without a discussion of how to "handle" or "escape" special
characters. This sample script demonstrates common conversion and transformation commands
that make sense to use with the response.write command:
filename=/learn/test/res5.asp
<html><head>
<title>res5.asp</title>
</head><body bgcolor="#FFFFFF">
<%
' The response object can be used to write text
' but sometimes some functions must be used to transform
' the text instead of sending as is to the browser
response.write "<B>Hyperion</b> by <I>Dan Simmons</i> is a great novel"
response.write "<p>"
response.write server.htmlencode("<B>Hyperion</b> by <I>Dan Simmons</i> is a great novel")
response.write "<p>"
response.write "Joe Smith & Hilda = a team"
response.write "<p>"
response.write server.URLencode("Joe Smith & Hilda = a team")
%>
</body></html>
|