Back to Devexpress

ASPxCallbackPanel Class

aspnet-devexpress-dot-web-698bfddd.md

latest8.8 KB
Original Source

ASPxCallbackPanel Class

A callback panel control that allows you to update its content on a callback.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxCallbackPanel :
    ASPxCollapsiblePanel
vb
Public Class ASPxCallbackPanel
    Inherits ASPxCollapsiblePanel

Remarks

The Callback Panel is a container area that allows you to update its content using an AJAX-based callback technology.

Create a Callback Panel

Design Time

The ASPxCallbackPanel control is available on the DX.25.2: Navigation & Layout toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control markup in the page’s source code.

aspx
<dx:ASPxCallbackPanel ID="ASPxCallbackPanel1" runat="server" Width="200px">
    <PanelCollection>
        <dx:PanelContent runat="server">
            <dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px">
            </dx:ASPxTextBox>
        </dx:PanelContent>
    </PanelCollection>
</dx:ASPxCallbackPanel>

Run Time

csharp
protected void Page_Load(object sender, EventArgs e)
{
    ASPxCallbackPanel cpanel = new ASPxCallbackPanel();
    cpanel.ID = "ASPxCallbackPanel1";
    cpanel.Controls.Add(new ASPxTextBox() { ID = "ASPxTextBox1", Text = "Test" });
    form1.Controls.Add(cpanel);
}
vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim cpanel As ASPxCallbackPanel = New ASPxCallbackPanel()
    cpanel.ID = "ASPxCallbackPanel1"
    cpanel.Controls.Add(New ASPxTextBox() With {
        .ID = "ASPxTextBox1",
        .Text = "Test"
    })
    form1.Controls.Add(cpanel)
End Sub

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

Client-Side API

The ASPxCallbackPanel’s client-side API is implemented with JavaScript language and exposed by the ASPxClientCallbackPanel object.

|

Availability

|

Available by default.

| |

Client object type

|

ASPxClientCallbackPanel

| |

Access name

|

ASPxPanelBase.ClientInstanceName

| |

Events

|

ASPxCallbackPanel.ClientSideEvents

|

Overview

The following API allows you to manipulate the callback panel on the client side:

Use the ASPxPanelContainerBase.Controls property to access the collection of the ASPxCallbackPanel ‘s child controls.

Example

Full example - How to implement a custom loading panel for the ASPxCallbackPanel control

javascript
function OnUpdateClick(s, e) { cp.PerformCallback("Update"); }
function OnCancelClick(s, e) { cp.PerformCallback("Cancel"); }
aspx
<dx:ASPxCallbackPanel ID="cp" runat="server" ClientInstanceName="cp" OnCallback="cp_Callback">
    <PanelCollection>
        <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
            <dx:ASPxGridView ID="gv1" runat="server" DataSourceID="ads1" KeyFieldName="CategoryID" />
            <dx:ASPxGridView ID="gv2" runat="server" DataSourceID="ads2" KeyFieldName="ProductID" />
        </dx:PanelContent>
    </PanelCollection>
</dx:ASPxCallbackPanel>
<dx:ASPxButton ID="updateBtn" runat="server" Text="Update" AutoPostBack="false">
    <ClientSideEvents Click="OnUpdateClick" />
</dx:ASPxButton>
<dx:ASPxButton ID="cancelBtn" runat="server" Text="Cancel" AutoPostBack="false">
    <ClientSideEvents Click="OnCancelClick" />
</dx:ASPxButton>AutoGenerateColumns
csharp
protected void cp_Callback(object sender, CallbackEventArgsBase e) {
    switch (e.Parameter) {
        case "Update":
            gv1.UpdateEdit();
            gv2.UpdateEdit();
            break;
        case "Cancel":
            gv1.CancelEdit();
            gv2.CancelEdit();
            break;
    }
}
vb
Protected Sub cp_Callback(ByVal sender As Object, ByVal e As CallbackEventArgsBase)
    Select Case e.Parameter
        Case "Update"
            gv1.UpdateEdit()
            gv2.UpdateEdit()
        Case "Cancel"
            gv1.CancelEdit()
            gv2.CancelEdit()
    End Select
End Sub

Online Demos

Online Examples

Implements

Show 14 items

IComponent

IDisposable

IParserAccessor

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IAttributeAccessor

IUrlResolutionService

INamingContainer

IPostBackDataHandler

IPostBackEventHandler

ICallbackEventHandler

IPropertiesOwner

Inheritance

Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxPanelContainerBase ASPxPanelBase ASPxCollapsiblePanel ASPxCallbackPanel MVCxCallbackPanel

See Also

ASPxCallbackPanel Members

Callback Panel

Callbacks

DevExpress.Web Namespace