eo_Callback Function

Manually triggers a client side callback.

Syntax
JavaScript
 function eo_Callback(id, param)

Parameters

id
The ID of the Callback control, see remark section for details.
param
Optional parameter for the callback. The parameter will be available through CallbackEventArgs.Parameter when the callback reaches the server side.

Return Value

Returns true if the callback was successful, otherwise false.

Remarks

Usually you do not need to call this function to trigger a callback. Use Callback.Triggers or CallbackPanel.Triggers to specify the trigger and the callback will be automatically triggered. Alternatively, you can use this function to manually trigger a callback:

HTML
<div onclick="eo_Callback('callback1', 'test')">Test Callback</div>
You can also use this function as a pseudo target url for a HTML link. However, when you do so, you need to use the keyword void to void the return value:
HTML
<a href="javascript:void eo_Callback('callback1', 'test')">Test Callback</a>
The void keyword is important as otherwise the browser will replace the current page with the return value of the function call.

Usually you can use the ID of the server control as the id parameter to call this function. However, when two server controls resides in different naming containers (for example, two user controls), it's possible for them to have the same ID. In this case you should use the value of the ClientID of the Callback control as the id parameter. You may need to use a debugger to find out the ClientID value.

The function returns true if the call were successful submitted. The call returns false when:

  • Two many previous callbacks are already queued up on this same Callback object, or;
  • Parameter id is incorrect.

Client side event handler Callback.ClientSideBeforeExecute, if supplied, will be called before this function returns. However, Callback.ClientSideAfterExecute is not guaranteed to be called before this function returns since the actual callback executes asynchronously.

See Also