ASPxPanelContainerBase.Controls Property
Gets a collection that contains child controls representing a panel’s content.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
ControlCollection | A ControlCollection that contains a panel’s child controls. |
Remarks
The Controls property allows you to programmatically access the instance of the ControlCollection class which contains child controls that represent a panel’s contents. You can add controls to the collection, remove controls from the collection, or iterate through the server controls in the collection.
Example
This example demonstrates how to use the SetVisible(visible) method and the client-side EndCallback event to show/hide controls implementing a simple verification wizard. You can implement the wizard by showing and hiding controls at each step and creating subsequent controls in the Callback event.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v14.2, Version=14.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to hide controls on client side after callback</title>
<script>
function SubmitRobotTest(s, e) {
CallbackPanel.PerformCallback();
}
function OnEndCallback(s, e) {
CaptchaLabel.SetVisible(false);
CaptchaRadioButtonList.SetVisible(false);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<dx:ASPxLabel ID="CaptchaLabel" ClientInstanceName="CaptchaLabel"
runat="server"
Text="Are you a robot? You have only one attempt!"
Width="200px">
</dx:ASPxLabel>
<dx:ASPxRadioButtonList ID="CaptchaRadioButtonList" ClientInstanceName="CaptchaRadioButtonList"
runat="server"
ValueType="System.Boolean"
SelectedIndex="0">
<Items>
<dx:ListEditItem Text="Yes" Value="true" />
<dx:ListEditItem Text="No" Value="false" />
</Items>
</dx:ASPxRadioButtonList>
<br />
<dx:ASPxButton ID="Button" runat="server" Text="Submit" AutoPostBack="false">
<ClientSideEvents Click="SubmitRobotTest" />
</dx:ASPxButton>
<dx:ASPxCallbackPanel ID="CallbackPanel" ClientInstanceName="CallbackPanel"
runat="server"
Width="200px"
OnCallback="CallbackPanel_Callback">
<ClientSideEvents EndCallback="OnEndCallback" />
</dx:ASPxCallbackPanel>
</form>
</body>
</html>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Controls property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.