当前位置:编程学习 > C#/ASP.NET >>

无法转换类型

问题:
报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;
         }
    }


类 --------------------编程问答-------------------- asp.net和winforms不能混用的。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,