foreach (Control control in this.Controls)
        {
            if (control is TextBox)
           {
               ((TextBox)control).Text.Equals ("");
           }        }

解决方案 »

  1.   

    你判断它相等干嘛?赋值是这样
    ((TextBox)control).Text = "";
      

  2.   

    foreach (Control control in this.Controls)
      {
      if (control is TextBox)
      {
      control.Text.Equals ("");
      }  }
    应该这样吧?
      

  3.   

    编译器错误信息: CS0117: “System.Web.UI.Control”并不包含“Text”的定义
    按你们的都改了,还这样报错!
      

  4.   

                foreach (Control control in Controls)
                {
                    if (control is TextBox)
                    {
                        ((TextBox)control).Text = string.Empty;
                    }
                }
      

  5.   

        foreach (Control control in this.Controls)
                {
                    if (control is TextBox)
                    {
                        ((TextBox)control).Text = "";
                    }
                }
      

  6.   

    foreach (Control control in this.Controls)
                {
                    if (control is TextBox)
                    {
                        ((TextBox)control).Text = "";
                    }
                }
    我以前也写得这个,可是报错!我就又改了一下,改成((TextBox)control).Text.Equals ("");
    可是还报错!现在改成 foreach (Control control in Controls)
                {
                    if (control is TextBox)
                    {
                        ((TextBox)control).Text = string.Empty;
                    }
                }
    不报错了,但是实现不了重置!