I have an ASP.NET webpage that displays steps that must be performed server side. Those steps must be performed in the specified order, and the precedding step must be completed before the next one starts. For example, the steps would be:
1) Performing action A : Completed
2) Performing action B : In progress
3) Performing action C : Waiting
4) Performing action D : Waiting
When a step is completed, the corresponding status (Completed, In progress or Waiting) must be updated on the page.
So, how would you guys do that?
Here’s what I have in mind:
The page calls a webmethod that performs the steps server side. When one step is completed, that webmethod updates a session variable that contains the step number and its status.
Then, every 5 seconds or so, the page calls another webmethod that checks the session variable and returns the step numbers that are completed. In javascript, update the status of the steps
Maybe there is a simpler way?
If it is possible that a person may close their browser & the steps should not be repeated, I’d consider using your DB or a cookie for the storage of steps and their corrosponding status.
It’s the ‘in progress’ and ‘waiting’ that are the major cruxes of your problem as you won’t be able to determine their state without some type of polling. I’ve done similar things before and used effectively the same method you described.