469,609 Members | 2,142 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Flushing servers buffer

In the following code when i = 500 the buffer on the server is flushed
to the client. However, because the content that is sent to the browser
contains an html table Internet Explorer does not display the table
until it receives the closing </table> tag. The question is, am I
correct in saying that the buffer on the server is CLEARED when i =
500? It will be empty for a split second until the loop resumes again.
Am I correct?

Dim i
i = 1
Response.Write("<table>")
For i = 1 to 1000
Response.Write("<tr><td>" & i & "</td></tr>")
i = i + 1
If i = 500 Then
Response.Flush()
End If
Loop
Response.Write("</table>")

Is this a good way to clear the buffer if I'm processing a very large
amount of data?

Jul 22 '05 #1
3 1679
CJM

"Andyza" <an****@webmail.co.za> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
In the following code when i = 500 the buffer on the server is flushed
to the client. However, because the content that is sent to the browser
contains an html table Internet Explorer does not display the table
until it receives the closing </table> tag. The question is, am I
correct in saying that the buffer on the server is CLEARED when i =
500? It will be empty for a split second until the loop resumes again.
Am I correct?


See:
http://www.intellidimension.com/defa...onse_flush.rsp

It suggests that a Flush() call clears the buffer...

CJM
Jul 22 '05 #2
The Flush() method requires Response.Buffer to be set to False.
When Response.Buffer = False any output gets sent back to the client as
the server completes it's processing (as opposed to being cached on the
server until all the processing is complete), so Response.Flush isn't
required.

Guess I should have read this first:
http://msdn.microsoft.com/library/de...9548d3f8b0.asp

Jul 22 '05 #3
Andyza wrote:
The Flush() method requires Response.Buffer to be set to False.
Ok, ok, I should have read what I posted... The Flush() method requires
Response.Buffer to be set to TRUE.
Then when the Flush() method is called the output gets sent back to the
client.

Guess I should have read this first:

<snip>

Guess I should have checked the url too! The correct one is:
http://msdn.microsoft.com/library/en...e01af7e6cb.asp

Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Farshid Lashkari | last post: by
4 posts views Thread by Stephan Steiner | last post: by
3 posts views Thread by Eric | last post: by
reply views Thread by Ethan Metsger | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.