手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >ASP.NET(C#)中遍历所有控件
ASP.NET(C#)中遍历所有控件
摘要:复制代码代码如下:for(inti=0;i

复制代码 代码如下:

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#)中遍历所有控件】相关文章:

javascript操作ASP.NET服务器控件

ASP.Net 分页控件源码

ASP.NET编程中的十大技巧

asp.net遍历目录文件夹和子目录所有文件

ASP.NET 创建带事件的用户控件

ASP.NET与数据库相关技巧

ASP.NET2.0服务器控件之类型转换器

ASP.NET中动态控制RDLC报表

ASP.NET2.0服务器控件之Render方法

ASP.NET方法如何重载的必备条件

精品推荐
分类导航