ASPxClientCallback.PerformCallback(parameter) Method

Sends a callback to the server and generates the server-side ASPxCallback.Callback event, passing it the specified argument.

Declaration

PerformCallback(
    parameter: string,
    onSuccess?: (arg: string) => void
): void

Parameters

Name Type Description
parameter string

A string value that represents any information that needs to be sent to the server-side ASPxCallback.Callback event.

onSuccess (arg: string) => void

A client action to perform if the server round-trip completed successfully.

Remarks

Use the PerformCallback method to asynchronously go to the server and perform server-side actions using AJAX-based technology. You can use the method’s parameter parameter to pass the required information from the client to the server side as a string of arguments. The method’s onSuccess parameter allows you to specify a client function that should be called when the callback is complete.

The PerformCallback method posts back to the server and fires a server-side ASPxCallback.Callback event. This event receives data from the PerformCallback method as the CallbackEventArgsBase.Parameter property.

Note that you can use the ASPxClientCallback.BeginCallback and ASPxClientCallback.EndCallback client events to perform custom actions before a callback is started and when it is complete.

Example

In the following example, a button click sends a callback to the server with sample information that is displayed in the text box when the callback is complete.

<script>
function onButtonClick (s, e) {
    callback.PerformCallback('Test');
}
function onEndCallback(s, e) {
    textBox.SetText(e.result);
}
</script>

<ASPxCallback ID="ASPxCallback1" runat="server" ClientInstanceName="callback" >
    <ClientSideEvents CallbackComplete="onEndCallback" />
</ASPxCallback>

<ASPxTextBox ID="ASPxTextBox1" runat="server" Text="" ClientInstanceName="textBox" >
</ASPxTextBox>

<ASPxButton ID="ASPxButton1" runat="server" AutoPostback="false" >
    <ClientSideEvents Click="onButtonClick" />
</ASPxButton>

Online Example

How to implement a single cell editing feature in the ASPxGridView online example.

Online Demo

See Also