Skip to main content

ASPxClientCallback.SendCallback(parameter) Method

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

Declaration

SendCallback(
    parameter: string
): 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.

Remarks

Use the SendCallback method if you need to asynchronously go to the server and perform some server-side processing using AJAX-based callback technology. You can pass the required information which can be collected on the client side as a string of arguments (for instance, in the “Name = Value;” form) via the SendCallback method’s parameter parameter.

The SendCallback method posts back to the server using the callback technology and generates a specific server-side ASPxCallback.Callback event. The method’s parameter argument is passed to the ASPxCallback.Callback event’s handler as the CallbackEventArgsBase.Parameter property. So, the necessary server-side actions can be performed in a handler of the ASPxCallback.Callback event based upon the values of the arguments which can be obtained by parsing the passed information string.

After the callback is processed in the ASPxCallback.Callback event’s handler, the resulting information can be passed back to the client side via the event’s CallbackEventArgs.Result property. Then, the client-side ASPxClientCallback.CallbackComplete event is generated on the client allowing the final client processing of the callback to be performed.

Example

function ShowImage(id) {
    if (ASPxCallback1.InCallback()) 
        return;
    document.getElementById('imageCell').innerHTML = 'Loading...';
    ASPxCallback1.PerformCallback(id);
}
protected void ASPxCallback1_Callback(object source, 
    DevExpress.Web.CallbackEventArgs e) {
    string xpath = string.Format("//items/item[@id='{0}']", e.Parameter);
    XmlNode node = XmlDataSource2.GetXmlDocument().SelectSingleNode(xpath);
    if(node != null) {
        LargeImage.ImageUrl = "Images/" + node.Attributes["FileName"].Value;
        LargeImage.AlternateText = node.Attributes["Text"].Value;
        LargeImageText.Text = node.Attributes["Text"].Value; 
    }
    e.Result = ASPxCallback.GetRenderResult(ImagePanel);
}
<dx:ASPxCallback ID="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback">
    <ClientSideEvents CallbackComplete="function(s, e) {
        document.getElementById('imageCell').innerHTML = e.result;
    }" />
</dx:ASPxCallback>
See Also