代码如下
遍历formview
1// fv 是formview实例
2 WebControl txtName = (WebControl)fv.FindControl("txtName");
3
4 // 从parent中获取Controls
5 ControlCollection ctls = txtName.Parent.Controls;
6
7 foreach (Control ctl in ctls)
8 {
9 //..
10 }
1// fv 是formview实例
2 WebControl txtName = (WebControl)fv.FindControl("txtName");
3
4 // 从parent中获取Controls
5 ControlCollection ctls = txtName.Parent.Controls;
6
7 foreach (Control ctl in ctls)
8 {
9 //..
10 }