ASPバッファのプロパティ
バッファ属性は、出力がバッファリングされているかどうかを指定します。 通常、ASPスクリプトがサーバ上で実行され、実行結果の各文は、クライアントブラウザ上に表示されるように送られます。 出力バッファが設定されている場合、サーバは、サーバスクリプトのすべてが処理されるまでブラウザに対する応答を防止、またはスクリプトがフラッシュまたはエンドメソッド呼び出しまでであろう。
注:このプロパティを設定した場合、それが.aspファイル<html>タグの前に来る必要があります。
文法
response.Buffer[=flag]
参数 | 描述 |
---|---|
flag | 布尔值,规定是否缓冲页面输出。
False 指示不缓存,服务器会一边处理一边发送输出。IIS version 4.0 默认为 False,而 IIS version 5.0 及更高的版本默认为 True。 True 指示缓冲。服务器不会发送输出,直到页面上的所有脚本被处理,或者直到 Flush 或 End 方法被调用。 |
例
例1
この例では、サイクルの終了前に、ブラウザの出力によって送信されません。 バッファがFalseに設定されている場合は、ブラウザの出力線にサイクルごとに一度。
<%response.Buffer=true%>
<html>
<body>
<%
for i=1 to 100
response.write(i & "<br>")
next
%>
</body>
</html>
<html>
<body>
<%
for i=1 to 100
response.write(i & "<br>")
next
%>
</body>
</html>
例2
<%response.Buffer=true%>
<html>
<body>
<p>I write some text, but I will control when
the text will be sent to the browser.</p>
<p>The text is not sent yet. I hold it back!</p>
<p>OK, let it go!</p>
<%response.Flush%>
</body>
</html>
<html>
<body>
<p>I write some text, but I will control when
the text will be sent to the browser.</p>
<p>The text is not sent yet. I hold it back!</p>
<p>OK, let it go!</p>
<%response.Flush%>
</body>
</html>
例3
<%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>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>
完全なレスポンスオブジェクトリファレンス