问题:我有动态控制,我将把它放到 pnlGetValues 单击一个按钮后,我在循环中找不到它。
string _name = Regex.Replace(_response.Name, @"\s+", "");
_dynamicTextbox.ID = "txtID";
_response.Required.ToString();
_dynamicTextbox.AutoPostBack = false;
_dynamicLabel.Text += "" + "<br><br>";
pnlGetValues.Controls.Add(_dynamicTextbox);
pnlGetValues.Controls.Add(_dynamicLabel);
protected void btnSubmit_Click(object sender, EventArgs e)
{
foreach (Control _control in pnlGetValues.Controls)
{
pnlGetValues.Controls.Count.ToString();
if (_control is TextBox)
{
TextBox _value = (TextBox)_control.Findcontrol("txtID");
}
}
}