for

ASP.NET(C#)中遍历所有控件
IT技术笔记

ASP.NET(C#)中遍历所有控件

106 1

for (int i = 0; i < this.Controls.Count; i++) { foreach (System.Web.UI.Control control in this.Controls[i].Controls) { if (control is TextBox) (control as TextBox).Text = ""; } } foreach (Control cl in this.Page.FindControl("Form1")