AJAX Page - Knowledge Base

« Back to Knowledge Base list

Send client parameters to server when using client panel update

Q:

How to send client parameters to server when using client panel update?

A:

Add client parameters as usual, using ob_post.AddParam client method.
Access the parameters server side using server property UpdatePanelParams.

Javascript
        ob_post.AddParam("id", "id");

C#
        string id = UpdatePanelParams["id"].ToString()

If you need to process the parameters before the panel updates use the OnBeforePanelUpdate event.

ASPX
<oajax:CallbackPanel id="cp1" runat="server" OnBeforePanelUpdate="cp1_OnBeforePanelUpdate"> ...

C#
public bool cp1_OnBeforePanelUpdate(string panelId, string containerId)
{
        string id = UpdatePanelParams["id"].ToString()

        // further processing before panel updates

        return true;
}



Check also how to retrieve values server-side tutorial.