469,578 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Response.flush question

Guys,

I need to send some info to my client while I'm processing some stuff. The flow will be something like :
-process
-response
-process
-response
....

I imagine to use response.flush (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
Nov 17 '05 #1
5 2333
Response.Buffer = true might be overriding your Flush.

Try something like this

Response.Buffer = false
Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

Michael
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message news:eu***************@TK2MSFTNGP10.phx.gbl...
Guys,

I need to send some info to my client while I'm processing some stuff. The flow will be something like :
-process
-response
-process
-response
...

I imagine to use response.flush (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 11/3/2003
Nov 17 '05 #2
Are you just testing using localhost as webserver?
This will always be the case.

See http://groups.google.com/groups?hl=e...TF-8&oe=UTF-8&
threadm=OW1teTvjDHA.1764%40tk2msftngp13.phx.gbl&rn um=2&prev=
/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DRe
sponse.Flush%26meta%3D

for IIS5/IIS6 Flush behavior on a non-local webserver.

- Fred W
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message news:<eu*************@TK2MSFTNGP10.phx.gbl>...
Guys,

I need to send some info to my client while I'm processing some stuff.
The flow will be something like :
-process
-response
-process
-response
...

I imagine to use response.flush (as I did on ASP) but it does not work.
See my test code, after sending 2 lines on response, I'm simulating a
processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
--

Nov 17 '05 #3
In fact I am testing on a web server and not at my own machine.....
"Fred W" <1.***@comcast.net> escreveu na mensagem
news:f8**************************@posting.google.c om...
Are you just testing using localhost as webserver?
This will always be the case.

See http://groups.google.com/groups?hl=e...TF-8&oe=UTF-8&
threadm=OW1teTvjDHA.1764%40tk2msftngp13.phx.gbl&rn um=2&prev=
/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DRe
sponse.Flush%26meta%3D

for IIS5/IIS6 Flush behavior on a non-local webserver.

- Fred W
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message

news:<eu*************@TK2MSFTNGP10.phx.gbl>...
Guys,

I need to send some info to my client while I'm processing some stuff.
The flow will be something like :
-process
-response
-process
-response
...

I imagine to use response.flush (as I did on ASP) but it does not work.
See my test code, after sending 2 lines on response, I'm simulating a
processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
--

Nov 17 '05 #4
Response.Flush has no meaning if Response.Buffer is false. If buffer is false, then there is nothing to flush, since it is delivered right away.

See my other response for the reason this does not work.

"Michael Pearson" <mi************************@televox.com> wrote in message news:Ou**************@TK2MSFTNGP09.phx.gbl...
Response.Buffer = true might be overriding your Flush.

Try something like this

Response.Buffer = false
Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

Michael
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message news:eu***************@TK2MSFTNGP10.phx.gbl...
Guys,

I need to send some info to my client while I'm processing some stuff. The flow will be something like :
-process
-response
-process
-response
...

I imagine to use response.flush (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 11/3/2003
Nov 17 '05 #5
In ASP.NET any code in your code-behind is completely processed before the page is delivered to the client machine. This is why flush is not working as it did in classic asp.

In .NET, the client doesn't get the page until the page creation, render and destruction sequence is completed.
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message news:eu***************@TK2MSFTNGP10.phx.gbl...
Guys,

I need to send some info to my client while I'm processing some stuff. The flow will be something like :
-process
-response
-process
-response
...

I imagine to use response.flush (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2 lines.

Response.Write("Line1<br>")
Response.Write("Line2<br>")
Response.Flush()
Dim i As Double
Do While i < 1000000000
i += 1
Loop
Response.Write("Line3<br>")
Response.Write("Line4<br>")

What hapens is that Line1 and Line2 comes only after processing time..

Ideas?

Thanks

Luiz
Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Jon Spivey | last post: by
9 posts views Thread by Dominic Godin | last post: by
7 posts views Thread by Stephanie | last post: by
1 post views Thread by Dan | last post: by
2 posts views Thread by David Union | last post: by
3 posts views Thread by Lars Netzel | last post: by
reply views Thread by jose.mendez22 | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.