【发布时间】:2015-02-02 20:20:13
【问题描述】:
我有一个禁用的面板。因此面板内的所有控件都被禁用。在回发时,我只需要启用一个禁用面板内的控件。请让我知道我们如何实现这一目标。下面是代码
<asp:Panel ID="testPanel" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:DropDownList ID="dropdownlist" runat="server"></asp:DropDownList>
</asp:Panel>
代码隐藏 aspx.cs
testpanel.Enabled = false;
dropdownlist.Enavbled=true;
此处的下拉列表未启用。 请让我知道启用它的方法。遍历面板是一种性能,因为它里面有很多控件。所以我需要一种更好的方法来启用 Disabled Panel 中的 DropDownList。
【问题讨论】:
-
除非显示父元素,否则无法显示子元素。
标签: c# asp.net code-behind