|
ASP六大对象介绍(4) <%Response.Buffer=True%> <html> <Head> <title>Buffer示例</title> </head> <body> <% for i=1 to 500 response.write(i & "<br>") next %> </body> </html> 这页执行时,整个主页的所有内容会同时显示在浏览器上,这个主页会存在缓存区中直到脚本执行结束。
2、EXPires属性 该属性用于设置浏览器缓存页面的时间长度(单位为分),必须在服务器端刷新。通过如下设置: <%Response.Expires=0%> 通过在ASP文件中加入这一行代码,要求每次请求是刷新页面,因为Response一收到页面就会过期。
3、Write方法 该方法把数据发送到客户端浏览器,如: <%Response.write "Hello,world!"%>
4、Redirect方法 该方法使浏览器可以重新定位到另一个URL上,这样,当客户发出Web请求时,客户端的浏览器类型已经确定,客户被重新定位到相应的页面。如: <html> <head> <title>Redirect示例</title> </head> <body> <form aciton="formjump.asp" method="post"> <select name="wheretogo"> <option selected value="fun">Fun</option> <option value="news">News</option> <option value="sample">Sample</option> </select> <input type=submit name="jump" value="Jump"> </form> </body> </html> 以上是提交的表单,下面是处理表单的文件formjump.asp: <%response.buff=true%> <html> <head> <title>Redirect示例</title> </head> <body> <% thisurl="http://www.tinyu.com/"; where=Request.form("wheretogo") Select Case where case "fun" response.redirect thisurl & "/fun/default.asp" case "news" response.redirect thisurl & "/news/default.asp" case "sample" response.redirect thisurl & "/sample/default.asp" End Select %> </body>
|