正如标题所示,我在访问表格控件 (System.Web.UI.WebControls.Table) 中的数据时遇到问题。布局基本上是一个基于 Web 的动态电子表格,每个 TableCell 中都有 TextBox 控件。我试图做类似下面代码的事情,但我无法访问数据。任何帮助,将不胜感激。
foreach (Control c in this.Controls)
{
if (c.GetType().ToString() == "System.Windows.Form.Textbox")
{
TextBox t = c as TextBox;
if (t.Text.Trim() != "")
{
// Do more things based on t.ID...
}
}
}