实现代码如下:

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").Controls)
{
if (cl.GetType().ToString() == "System.Web.UI.WebControls.TextBox")
{
((TextBox)cl).Text = "";
}
}

以上就是【ASP.NET(C#)中遍历所有控件】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论