Flushing the Buffer in .Net

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Good afternoon,

Can anyone help me with flushing the buffer in ASP.NET. I have a set of
functions that perform a series of maintainence operations. As these
functions are called sequentially, each contains a status as to the success
or failure of the particular process. I want to be able to send to the
client each output string at it happens. The way it is working right now is
that it is storing the output until all of the functions are complete.

Many thanks.
 
Eric said:
Can anyone help me with flushing the buffer in ASP.NET. I have a set of
functions that perform a series of maintainence operations. As these
functions are called sequentially, each contains a status as to the success
or failure of the particular process. I want to be able to send to the
client each output string at it happens. The way it is working right now is
that it is storing the output until all of the functions are complete.

Have you tried putting Response.Flush() after each function has
completed processing? Technical docs for this method available at:
http://msdn.microsoft.com/library/d...frlrfSystemWebHttpResponseClassFlushTopic.asp

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
turn off page buffering

Page.Response.BufferOutput = false;

then use a flush to ouput the message

Page.Response.Flush();

be sure your markup is simple, or the browser will not render it, but wait
for the complete page.

-- bruce (sqlwork.com)
 
The Page.Response.BufferOutput did the trick....

As the status information is added it eventually outgrows the status
textbox, is there any way to scroll the text box as each item is entered so
the user sees the latest process completed?

Many thanks.
 
Back
Top