无法转换类型
陈城玮 2013-04-20 09:38:23 问题:
报System.Windows.Forms.Control 无法将类型为“System.Web.UI.LiteralControl”的对象强制转换为类型“System.Windows.Forms.Control”?????
代码:
foreach (System.Windows.Forms.Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox td = (System.Windows.Forms.TextBox)control;
td.Text = String.Empty;
}
}