aspnet-devexpress-dot-web-698bfddd.md
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
public class ASPxCallbackPanel :
ASPxCollapsiblePanel
Public Class ASPxCallbackPanel
Inherits ASPxCollapsiblePanel
The Callback Panel is a container area that allows you to update its content using an AJAX-based callback technology.
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.
<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>
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);
}
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.
The ASPxCallbackPanel’s client-side API is implemented with JavaScript language and exposed by the ASPxClientCallbackPanel object.
|
Availability
|
Available by default.
| |
Client object type
|
| |
Access name
|
ASPxPanelBase.ClientInstanceName
| |
Events
|
ASPxCallbackPanel.ClientSideEvents
|
The following API allows you to manipulate the callback panel on the client side:
The (ASPxClientCallbackPanel.PerformCallback) method - Sends a callback to the server.
The CallbackClientSideEventsBase.BeginCallback event - Allows you to perform custom actions when a callback is sent to the server side.
The ASPxCallbackPanel.Callback event - Allows you to handle a callback on the server side.
The CallbackClientSideEventsBase.EndCallback event - Allows you to perform custom actions when a callback comes from the server side.
Use the ASPxPanelContainerBase.Controls property to access the collection of the ASPxCallbackPanel ‘s child controls.
Full example - How to implement a custom loading panel for the ASPxCallbackPanel control
function OnUpdateClick(s, e) { cp.PerformCallback("Update"); }
function OnCancelClick(s, e) { cp.PerformCallback("Cancel"); }
<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
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;
}
}
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
Show 14 items
Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxPanelContainerBase ASPxPanelBase ASPxCollapsiblePanel ASPxCallbackPanel MVCxCallbackPanel
See Also