Response.Write in foreach live update?
I have a foreach which imports data to 开发者_如何学Goour CMS. Now I want to display a message with the current row info after every run. I don't want that the information is comming after the whole procedure. The message have to come step by step.
foreach()
{
// my import procedure
Response.Write("row x updated");
}
How can I do that? Can I do that with Response.Flush? Or do I have to make it else?
Best regards Michael
Set this once before you loop:
Response.BufferOutput = false;
Then call Response.Flush()
every time you want to update the client.
Response.Flush() seems to be the way to go. Otherwise, the responses are buffered.
精彩评论