<html>
<body>
<%
response.write("<h2>You can use HTML tags to format the
text!</h2>")
%>
<%
response.write("<p style='color:#0000ff'>This text is styled with
the style attribute!</p>")
%>
</body>
</html>
You can use HTML tags to format the
text!
This text is styled with the style
attribute!
Redirect the user to
another URL
<%
if Request.Form("select")<>"" then
Response.Redirect(Request.Form("select"))
end if
%>
<html>
<body>
<form action="redirect_demo.asp" method="post">
<input type="radio" name="select"
value="server_demo.asp">
Server Example<br>
<input type="radio" name="select"
value="text_text.asp">
Text Example<br><br>
<input type="submit" value="Go!">
</form>
</body>
</html>
Server
Example
Text
Example
Random links
<html>
<body>
<%
randomize()
r=rnd()
if r>0.5 then
response.write("<a href='http://www.w3schools.com'>W3Schools.com!</a>")
else
response.write("<a href='http://www.refsnesdata.no'>Refsnesdata.no!</a>")
end if
%>
<p>
This example demonstrates a link, each time you load the page, it
will display
one of two links: W3Schools.com! OR Refsnesdata.no! There is a 50%
chance for
each of them.
</p>
</body>
</html>
W3Schools.com!
This example demonstrates a link, each time you load the page, it
will display one of two links: W3Schools.com! OR Refsnesdata.no!
There is a 50% chance for each of them.
Controlling the buffer
<%
Response.Buffer=true
%>
<html>
<body>
<p>
This text will be sent to your browser when my response buffer is
flushed.
</p>
<%
Response.Flush
%>
</body>
</html>
This text will be sent to your browser when my
response buffer is flushed.
Clear the buffer
<%
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>
End a script in the middle
of processing
<html>
<body>
<p>I am writing some text. This text will never be<br>
<%
Response.End
%>
finished! It's too late to write more!</p>
</body>
</html>
I am writing some text. This text will never be
End a script in the middle
of processing
<%Response.Expires=-1%>
<html>
<body>
<p>This page will be refreshed with each access!</p>
</body>
</html>
This page will be refreshed with each access!
Check if the user is still
connected
<html>
<body>
<%
If Response.IsClientConnected=true then
Response.Write("The user is still connected!")
else
Response.Write("The user is not connected!")
end if
%>