欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【ASP基础教程之实例学习ASP Response 对象】,下面是详细的分享!
ASP基础教程之实例学习ASP Response 对象
ASP Response 对象用于从服务器向用户发送输出的结果。
实例
使用ASP写文本
本例演示如何使用ASP来写文本。
| 以下为引用的内容: <html> <body> <% response.write("Hello World!") %> </body> </html> |
在ASP中使用HTML标签格式化文本
本例演示如何使用ASP将文本和HTML标签结合起来。
| 以下为引用的内容: <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> |
将用户重定向至不同的URL
本例演示如何将用户重定向至另一个的URL。
| 以下为引用的内容: <% |
显示随机的链接
本例演示一个超级链接,当您每次载入页面时,它将显示两个链接中的其中一个。
| 以下为引用的内容: <html> |
控制缓存
本例演示如何控制缓存。
| 以下为引用的内容: <% |
清空缓存
本例演示如何清空缓存。
| 以下为引用的内容: <% 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> |
在处理过程中终止脚本并返回结果
本例演示如何在处理过程中中断脚本的运行。
| 以下为引用的内容: <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> |
设置在页面失效前把页面在浏览器中缓存多少分钟
本例演示如何规定页面在失效前在浏览器中的缓存时间。
| 以下为引用的内容: <%Response.Expires=-1%> <html> <body> <p>This page will be refreshed with each access!</p> </body> </html> |
设置页面缓存在浏览器中的失效日期或时间
本例演示如何规定页面在浏览器中的缓存时间日期或时间
| 以下为引用的内容: <% Response.ExpiresAbsolute=#May 05,2001 05:30:30# %> <html> <body> <p>This page will expire on May 05, 2001 05:30:30!</p> </body> </html> |
检查用户是否仍然与服务器相连
本例演示如何检查用户是否已与服务器断开。
| 以下为引用的内容: <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> |
设置内容类型
本例演示如何规定内容的类型。
| 以下为引用的内容: <% Response.ContentType="text/html" %> <html> <body> <p>This is some text</p> </body> </html> |
设置字符集
本例演示如何规定字符集的名称。
| 以下为引用的内容: <% Response.Charset="ISO8859-1" %> <html> <body> <p>This is some text</p> </body> </html> |
Response 对象
ASP Response 对象用于从服务器向用户发送输出的结果。它的集、属性和方法如下:



以上所分享的是关于ASP基础教程之实例学习ASP Response 对象,下面是编辑为你推荐的有价值的用户互动:
相关问题:ASP.NET基础教程(C#案例版)小说txt全集免费下载
答:ASP.NET基础教程(C#案例版) txt全集小说附件已上传到百度网盘,点击免费下载: 应该是全本了 >>详细
相关问题:完全接触ASP之基础与实例txt全集下载
答:完全接触ASP之基础与实例 txt全集小说附件已上传到百度网盘,点击免费下载: >>详细
相关问题:6. 列举出ASP常用的5个内置对象,说明其作用。
答:系统学习ASP,就是先从ASP的几大内置对象开始的. 一般称五大对象:Request、Response、Server、Session、Application Request对象——获取客户端传入信息 Response对象——向客户端发送信息 Session对象——存储单个用户会话信息 Application对象——应... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
