开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜