Есть такой код в разметке
<asp:Panel ID="VerticalMainPanel" runat="server">
<table>
<tr id="divPost" runat="server">
<td>
<asp:Label ID="lblPost" runat="server" CssClass="filterdata" Text=""></asp:Label>
</td>
<td>
<asp:TextBox ID="tbxPost" runat="server" TabIndex="13" MaxLength="200"></asp:TextBox>
</td>
</tr>
<tbody id="divForeignCitizen" runat="server">
<tr>
<td>
<asp:Label ID="blVisaNumber" runat="server" CssClass="filterdata" Text=""></asp:Label>
</td>
<td>
<asp:TextBox ID="tbxVisaNumber" runat="server" TabIndex="18" MaxLength="200"></asp:TextBox>
</td>
</tr>
</tbody>
</table>
</asp:Panel>
так вот я не могу доступ получить к контролам внутри tbody и tr.
пишу так
var ParentPanel = VerticalMainPanel.Controls;
foreach (var ctrl in ParentPanel)
{
if (ctrl is TextBox)
{
TextBox tbx = ctrl as TextBox;
if (tbx.Visible)
tbx.Text = string.Empty;
}
else if (ctrl is CheckBox)
{
CheckBox cbx = ctrl as CheckBox;
if (cbx.Visible)
cbx.Checked = false;
}
else if (ctrl is RadioButtonList)
{
RadioButtonList rbl = ctrl as RadioButtonList;
if (rbl.Visible)
rbl.SelectedIndex = 0;
}
else if (ctrl is HtmlTableRow)
{
m_ClearRecControls((ctrl as Control).Controls);
}
}
что не так делаю?