void DisplayAllControls(Control topctrl){
foreach(Control ctrl in topctrl.Controls){
if(ctrl.GetType().ToString()=="Label")
{
........
}
if(ctrl.HasControls())
DisplayAllControls(ctrl);
}
}
foreach(Control ctrl in topctrl.Controls){
if(ctrl.GetType().ToString()=="Label")
{
........
}
if(ctrl.HasControls())
DisplayAllControls(ctrl);
}
}
解决方案 »
- 在线编辑word文档的问题
- ajax简单相应信息问题????
- 请问如何获得WebGrid当前选择的一行?
- 我的作品,欢迎大家给点意见
- 100分求解:升級到asp.net2.0之後,DataGrid中的動態控件的ClientID與原來不一致
- substring载取字符串问题
- 更改确认对话框字体的颜色
- 加入using System.Data.OracleClient;报错
- asp.net中使用资源文件的问题,谢谢!
- datagrid分页以后怎么编辑。
- 现在我知道一棵树的子接点,现在要找到它的第一个父亲,如何找(也就是如何判断对象为空的情况)
- Help,用datarelation把2个相关联的表的内容显示在同一个datagrid中的方法.
private void InitData(Control crol)
foreach(Control child in crol.Controls)
{
if(child.Controls.Count>0)
{ InitData(child);
}else
{if(!(child is LiteralControl))
{
if(child is Lable)
{
..........
}
}
}
}
{
if(ctr.GetType().ToString()=="System.Web.UI.WebControls.Label")
{
Response.Write("ID:"+ctr.ID+" TEXT:"+((Label)ctr).Text+"<br>");
}}