国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP基礎(chǔ)教程之實(shí)例學(xué)習(xí)ASP Response 對(duì)象_ASP教程

2024-05-04 11:03:32
字體:
供稿:網(wǎng)友

推薦:ASP 3.0高級(jí)編程(四十三)
9.3.5 數(shù)據(jù)高速緩存首先需要注意的是,數(shù)據(jù)高速緩存與記錄集高速緩存雖然都用于改善性能,但兩者是無關(guān)的。數(shù)據(jù)高速緩存是臨時(shí)的數(shù)據(jù)存儲(chǔ)區(qū),允許使用高速緩存中的數(shù)據(jù),而不是重新生成新的數(shù)

ASP Response 對(duì)象用于從服務(wù)器向用戶發(fā)送輸出的結(jié)果。

實(shí)例

使用ASP寫文本

本例演示如何使用ASP來寫文本。

以下為引用的內(nèi)容:
<html>
<body>
<%
response.write("Hello World!")
%>
</body>
</html>

在ASP中使用HTML標(biāo)簽格式化文本

本例演示如何使用ASP將文本和HTML標(biāo)簽結(jié)合起來。

以下為引用的內(nèi)容:
<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

本例演示如何將用戶重定向至另一個(gè)的URL。

以下為引用的內(nèi)容:

<%
if Request.Form("select")<>"" then
Response.Redirect(Request.Form("select"))
end if
%>
<html>
<body>
<form action="/example/aspe/demo_aspe_redirect.asp" method="post">
<input type="radio" name="select"
value="/example/aspe/demo_aspe_server.asp">
Server Example<br>
<input type="radio" name="select"
value="/example/aspe/demo_aspe_text.asp">
Text Example<br><br>
<input type="submit" value="Go!">
</form>
</body>
</html>

顯示隨機(jī)的鏈接

本例演示一個(gè)超級(jí)鏈接,當(dāng)您每次載入頁面時(shí),它將顯示兩個(gè)鏈接中的其中一個(gè)。

以下為引用的內(nèi)容:

<html>
<body>
<%
randomize()
r=rnd()
if r>0.5 then
response.write("<a >CuoXIn.com</a>")
else
response.write("<a >www.CuoXIn.com</a>")
end if
%>
<p>
This example demonstrates a link, each time you load the page, it will display
one of two links: CuoXIn.com! OR www.CuoXIn.com! There is a 50% chance for
each of them.
</p>
</body>
</html>

控制緩存

本例演示如何控制緩存。

以下為引用的內(nèi)容:

<%
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>

清空緩存

本例演示如何清空緩存。

以下為引用的內(nèi)容:
<%
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>

在處理過程中終止腳本并返回結(jié)果

本例演示如何在處理過程中中斷腳本的運(yùn)行。

以下為引用的內(nèi)容:
<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>

設(shè)置在頁面失效前把頁面在瀏覽器中緩存多少分鐘

本例演示如何規(guī)定頁面在失效前在瀏覽器中的緩存時(shí)間。

以下為引用的內(nèi)容:
<%Response.Expires=-1%>
<html>
<body>
<p>This page will be refreshed with each access!</p>
</body>
</html>

設(shè)置頁面緩存在瀏覽器中的失效日期或時(shí)間

本例演示如何規(guī)定頁面在瀏覽器中的緩存時(shí)間日期或時(shí)間

以下為引用的內(nèi)容:
<%
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>

檢查用戶是否仍然與服務(wù)器相連

本例演示如何檢查用戶是否已與服務(wù)器斷開。

以下為引用的內(nèi)容:
<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>

設(shè)置內(nèi)容類型

本例演示如何規(guī)定內(nèi)容的類型。

以下為引用的內(nèi)容:
<%
Response.ContentType="text/html"
%>
<html>
<body>
<p>This is some text</p>
</body>
</html>

設(shè)置字符集

本例演示如何規(guī)定字符集的名稱。

以下為引用的內(nèi)容:
<%
Response.Charset="ISO8859-1"
%>
<html>
<body>
<p>This is some text</p>
</body>
</html>

Response 對(duì)象

ASP Response 對(duì)象用于從服務(wù)器向用戶發(fā)送輸出的結(jié)果。它的集、屬性和方法如下:

分享:用好ASP.NET 2.0的URL映射
簡介: URL映射是ASP.NET 2.0中提供的新特性。URL映射技術(shù)幫助我們將一個(gè)特定URL映射為另一個(gè)URL。為了幫助理解,我們假設(shè)你在站點(diǎn)有一個(gè)叫Homepage.aspx的頁面來訪問主頁,所有的用戶也都用

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 济宁市| 西乌珠穆沁旗| 陈巴尔虎旗| 莱芜市| 山东省| 磐安县| 芜湖市| 忻州市| 科技| 壤塘县| 南靖县| 定边县| 东乡县| 道孚县| 新乐市| 九江市| 长垣县| 河西区| 保康县| 南通市| 永安市| 琼中| 甘德县| 犍为县| 福鼎市| 沭阳县| 定安县| 如皋市| 九龙坡区| 张家港市| 海兴县| 鱼台县| 高雄县| 丹寨县| 宜川县| 察隅县| 湛江市| 同江市| 牡丹江市| 普安县| 东莞市|