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.
Loading
RobertPosted Jun 5, 2008, 9:39 AM
Ryan AlfordPosted Jun 4, 2008, 3:07 PM
to do this, you would probably need to do some javascript and have it update the counter.
you could probably do a search for "asp.net javascript counter" and find some good examples.