System.Web.UI.Page.AddOnPreRenderCompleteAsync Method

Registers beginning and ending event handler delegates for an asynchronous page.

Syntax

public void AddOnPreRenderCompleteAsync (System.Web.BeginEventHandler beginHandler, System.Web.EndEventHandler endHandler, object state)

Parameters

beginHandler
The delegate for the System.Web.BeginEventHandler method.
endHandler
The delegate for the System.Web.EndEventHandler method.
state
An object containing state information for the event handlers.

Remarks

Use the Page.AddOnPreRenderCompleteAsync(System.Web.BeginEventHandler, System.Web.EndEventHandler, object) method to add handlers that require state information to an asynchronous Web page. The object passed in the state parameter can be any object that your application requires to transfer information between event handler delegates specified in the beginHandler and the endHandler parameters.

You can register multiple asynchronous handlers; however, only one handler runs at a time. If you want to process multiple asynchronous methods simultaneously, you should use a single System.Web.BeginEventHandler method and launch multiple asynchronous operations from that handler.

The asynchronous handlers are called between the Control.PreRender and Page.PreRenderComplete events.

First, all System.Web.UI.Page events (through the Control.PreRender event) are run, and then each registered System.Web.BeginEventHandler method is called. When the handler completes, the corresponding System.Web.EndEventHandler method is called. If there are multiple asynchronous handlers, the next handler is called.

After the registered asynchronous event handlers have been called, the rest of the page events are called, beginning with the Page.PreRenderComplete event.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0