Robert

Robert

  • NA
  • 3
  • 0

help with c# script

Jun 4 2008 2:45 PM
I am running a C# Web App that is in a for loop performing some work. The code is running on the server. I added the following code to try to display a running count to the user. I only want the count to update every 100 cycles.

// display running count to user
msgCnt += 1;
if ((msgCnt % 100) == 0) lblCount.Text = "Count: " + msgCnt;

The count does not display until the loop ends and the page gets posted back to the browser. It may be several minutes until the loop finishes and I need to keep the user updated on the progress.

How can I display the count in a label while the loop is running???
-----------------------------------------------------------------------

I looked into Client-Callback but I only found examples where a user has to click a button.

Answers (2)