webform:
Code
foreach (Control control in this.Form.Controls)
{
if (control is System.Web.UI.WebControls.TextBox)
{
TextBox txt = (TextBox)control;
txt.Text = "fdsafds";// string.Empty;
}
}
winform:
Code
foreach (System.Windows.Forms.Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;
tb.Text = String.Empty ;
}
}
恶寒!刚刚就看了哈首页的要求,可能是无意点了哈那四行字 怎么就发到首页去了,尴尬!