Skip to main content

MVCxClientPopupControl.PerformWindowCallback(window, data) Method

Sends a callback with a parameters to update the popup window by processing the related popup window and the passed information on the server, in an Action specified by the PopupControl’s PopupControlSettingsBase.CallbackRouteValues property.

Declaration

PerformWindowCallback(
    window: ASPxClientPopupWindow,
    data: any
): void

Parameters

Name Type Description
window ASPxClientPopupWindow

A ASPxClientPopupWindow object identifying the processed popup window.

data any

An object containing any information that needs to be passed to a handling Action specified by the PopupControlSettingsBase.CallbackRouteValues property.

Remarks

Use the PerformWindowCallback method if you need to dynamically update the PopupControl by asynchronously going to the server (using AJAX-based callback technology) and performing server-side processing in the specified Action. With the PerformWindowCallback method’s data parameter, you can pass any information collected on the client to the server for further server processing.

The PerformCallback method posts back to the server using the callback technology and is handled in an Action specified by the PopupControl’s PopupControlSettingsBase.CallbackRouteValues property. Any data passed via the method’s data parameter can be accessed on the server as a parameter of the specified Action. So, the necessary server-side actions can be performed in the handling Action based upon the value(s) passed from the client.

For instance, you can pass values as a hash table.

Client Script Code:

myPopupControl.PerformWindowCallback(myPopupWindow, {isVisible: myPopupControl.IsWindowVisible(myPopupWindow)})

At the controller code, you can access the windowIndex parameter that is the index of a popup window which performed the callback.

Controller Code:

public ActionResult PopupControlPartial(int windowIndex, bool isVisible) {
        ...
        return PartialView();
    }

The PopupControl automatically updates itself (it is rendered again) after a custom callback has been sent and processed on the server.

If you need to perform actions on the client-side before callback processing, handle the MVCxClientPopupControl.BeginCallback event.

See Also