Link to home
Start Free TrialLog in
Avatar of tapdev72
tapdev72

asked on

Need to show real-time status, as long process is running

Using ASP.NET, and ajax update-panels already.  Have this 'Process' button, which starts
a long synchronous process, where it is doing some work with the database.  Based on items
selected, this process could take long time to finish, maybe 10-15 minutes.  I need to show
the user real-time, as parts of the long process is finished.  Have a label at the bottom,
but this shows up with all the detailed statuses, after the process is finished,
which really does not help the user.  What if it has hung up.

While the process is running, how do we update that label at the same time this process is
running.
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Put the process into a thread - that informs the UI of the current status of process.

(Running a long process in the UI thread just blocks that until the process is finished - as you have found - UNLESS you can somehow interrupt the process at intervals and run a 'DoEvents' to process the message queue)
Avatar of tapdev72
tapdev72

ASKER

The processing is basically calling different stored procedures via ADO.NET till it finishes processing.
In C# there is an Application.DoEvents which will process messages

so call SP1, update your progress thingy then DoEvents, SP2, Process thingy, DoEvents, SP3, ......  where Process thingy is changing your label and other things to show the user how far it has progressed.
DoEvents is for winforms. this is ASP.NET.
I know (one of the topics this question is in is C#).  I don't know ASP.net well enough to say if/what the equivalent command is called.
SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial