System.Web.UI.ClientScriptManager.GetCallbackEventReference Method

Obtains a reference to a client function that, when invoked, initiates a client call back to server events. The client function for this overloaded method includes a specified control, argument, client script, context, error handler, and Boolean value.

Syntax

public string GetCallbackEventReference (Control control, string argument, string clientCallback, string context, string clientErrorCallback, bool useAsync)

Parameters

control
The server System.Web.UI.Control that handles the client callback. The control must implement the System.Web.UI.ICallbackEventHandler interface and provide a ICallbackEventHandler.RaiseCallbackEvent(string) method.
argument
An argument passed from the client script to the server ICallbackEventHandler.RaiseCallbackEvent(string) method.
clientCallback
The name of the client event handler that receives the result of the successful server event.
context
The client script that is evaluated on the client prior to initiating the callback. The result of the script is passed back to the client event handler.
clientErrorCallback
The name of the client event handler that receives the result when an error occurs in the server event handler.
useAsync
true to perform the callback asynchronously; false to perform the callback synchronously.

Returns

The name of a client function that invokes the client callback.

Remarks

This overload of the erload:System.Web.UI.ClientScriptManager.GetCallbackEventReference method requires a useAsync and a clientErrorCallback parameter. The useAsync parameter allows you to perform the client callback asynchronously by setting the value to true. The overload versions of this method that do not require the useAsync parameter set the value to false by default. The clientErrorCallback parameter allows you to define the name of the client function that is called if the server handler (the ICallbackEventHandler.RaiseCallbackEvent(string) method) returns an error. The overload versions of this method that do not require the clientErrorCallback parameter set the value to null.

For more information on this method, see the remarks for the overload ClientScriptManager.GetCallbackEventReference(Control, string, string, string) method.

Requirements

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