The WaitPage framework allows a 'wait page' to be integrated into such ASP.NET applications, which is then displayed while the user waits for the completion of the long running task. This special ‘wait page’ can also display progress information, to reassure the user that the task is actually taking place.
A ‘Wait page’ is simply a Webform which displays a message to the user, such as 'Please Wait', while some long running task is still running. It can also display additional information about the progress so far. The framework detects when the work has completed and automatically redirects to a 'results' page, which could also be, and often is, the page from which the long running task was initiated.
A summary of the steps that need to be performed to integrate an ASP.NET Web Application with the WaitPage Framework, are:
| Class | Description |
|---|---|
| BaseTaskWaiter | BaseTaskWaiter is an abstract class which implements the ITaskWaiter and provides some of the implementation. It has a default waiting message, and also allows progress messages to be set. In the constructor, you must pass in the URL of the results page, and optionally a custom waiting message to override the default one if necessary, and a flag to indicate whether you want to use the progressMessage feature. |
| ResultsStatusNotificationArgs | Event arguments class used to notify listeners about the status of the results. |
| WaitPageHelper | The WaitPageHelper is the main coordinator class of the entire framework. It allows the registration of an ITaskWaiter object, checks this regularly to see whether the task has finished, and redirects to the results page when this happens. |
| WaitPageInvalidContextException | Special WaitPage Framework exception class. Used to indicate that a WaitPage framework was called in an invalid context, normally when a function expects an ITaskWaiter to be registered when there isn't one. |
| Interface | Description |
|---|---|
| ITaskWaiter | An object implementing ITaskWaiter is registered with the framework, and is used to wait for a particular long running task to finish, and to obtain the results when it does. The methods in ITaskWaiter allow the WaitPageHelper to determine if the task has finished, get results and send notification that results are ready, and to get an (optional) progress message. One method also provides the URL which the mechanism will redirect to as soon as the results of the long running task are available. |
| IWaitPage | IWaitPage is a very simple interface with just one method, which has to be implemented by the Wait page(s) used in your application. It's sole purpose is to allow the Wait page mechanism to write out an optional progress message. This mechanism could easily be adapted to display a progress bar or something similar. |
| Delegate | Description |
|---|---|
| NotifyResultsStatusEventHandler | The delegate associated with the NotifyResultsStatus event in BaseTaskWaiter. See BaseTaskWaiter. |