开发者

Response.Write in foreach live update?

开发者 https://www.devze.com 2022-12-21 23:17 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消