手机
当前位置:查字典教程网 >编程开发 >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#)中遍历所有控件】相关文章:

ASP.NET中动态控制RDLC报表

ASP.NET用户控件技术

ASP.Net不执行问题一解

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

ASP.NET MVC中将控制器分离到类库的实现

ASP.NET(C#)将数据导出到Word或Excel

ASP.NET中的URL映射技巧

ASP.Net 分页控件源码

在ASP.NET中实现多文件上传的方法

ASP.NET c#生成随机数

精品推荐
分类导航