【发布时间】:2013-05-08 11:23:47
【问题描述】:
特别是一个文本框已被跳过。 ID 为“q3TXT”的文本框位于一个面板中,该面板隐藏在 PageLoad 方法中。
然而它在收集控件的函数之前变得可见。
收集所有其他文本框。
我尝试过使用 IEnumberable 文本框集合,但没有成功。
如何让文本框出现在控件列表中?
这里是html:
<p id="question3Text" runat="server" class="question"></p>
<asp:RadioButtonList runat="server" ID="q3_RBList" AutoPostBack="true" OnSelectedIndexChanged="q3_RBList_SelectedIndexChanged">
</asp:RadioButtonList>
<asp:Panel runat="server" ID="q3Panel">
<p>If no, when did data collection stop?</p>
<asp:TextBox runat="server" ID="q3TXT"></asp:TextBox>
</asp:Panel><br /><br />
还有一部分c#代码:
foreach (var item in this.Controls.OfType<TextBox>())
{
//some code
}
【问题讨论】:
标签: c# textbox controls dotnetnuke