<Complete oggetto risposta di riferimento
La proprietà Buffer specifica se tampone l'uscita o meno. Quando l'uscita è tamponato, il server da ostacolare la risposta al browser fino a quando tutti gli script del server sono stati elaborati, o fino a quando lo script chiama il metodo Flush o End.
Note: Se questa proprietà è impostata, dovrebbe essere prima del <html> tag nel file ASP
Sintassi
response.Buffer[=flag]
Parametro | Descrizione |
---|---|
flag | Un valore booleano che specifica se al buffer all'uscita pagina oppure no. False indica alcun buffering. Il server invierà l'uscita non appena viene elaborato. False è predefinita per IIS versione 4.0 (and earlier) . Predefinito per IIS versione 5.0 (e versioni successive) è vero. True indica buffering. Il server non invierà in uscita fino a quando tutti gli script nella pagina sono stati elaborati, o fino a quando il metodo Flush o End è stato chiamato. |
Esempi
esempio 1
In questo esempio, non vi sarà alcuna uscita inviato al browser prima che il ciclo è finito. Se tampone è stato impostato su False, allora sarebbe scrivere una riga al browser ogni volta che è passata attraverso il ciclo.
<%response.Buffer=true%>
<html>
<body>
<%
for i=1 to 100
response.write(i & "<br>")
next
%>
</body>
</html>
esempio 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>
esempio 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>
<Complete oggetto risposta di riferimento