Page::ExecuteRegisteredAsyncTasks Method ()
Starts the execution of an asynchronous task.
Assembly: System.Web (in System.Web.dll)
Define an asynchronous task using the PageAsyncTask class. After the task is defined, and is registered with the page using the RegisterAsyncTask method, the method can be invoked to begin the asynchronous task.
The PreRenderComplete event. Call the method for tasks you want to be invoked at times other than the automatic call to this method. Note, asynchronous tasks will be executed only once even though may be called more than once.method is automatically called at the point in the page processing when any registered asynchronous tasks, if they exist, are invoked for a non-asynchronous page. This automatic call to occurs just before the
The AsyncTimeout property is reset on every call to the method. The last value of the AsyncTimeout prior to invoking the method takes precedence. If an asynchronous task takes more than the AsyncTimeout, subsequent tasks invoked during that call are timed out immediately.
The following code example demonstrates the use of the AsyncTimeout property with the and RegisterAsyncTask methods. Note the use of beginning, ending, and time-out handlers. In the example, an artificial delay is introduced to demonstrate the situation of an asynchronous task exceeding the allotted time for the task as specified in the AsyncTimeout property. In a real-world scenario, an asynchronous task could be used to perform database calls or image generation, for example, and the time-out handler provides graceful degradation if the task is not performed in a specified amount of time.
Available since 2.0