zoukankan      html  css  js  c++  java
  • FindControl

    Here is some C# code which should be easy to convert. Pass in the id "lblRecTonT" and the control collection Page.controls or GridView1.Controls. This is guaranteed to work if the ID exists.
    public static System.Web.UI.Control FindControl(string controlId, System.Web.UI.ControlCollection controls)
                {
                      for (int counter = 0; counter < controls.Count; ++counter) // loop through each control in the control collection
                      {
                            if (controls[counter].ID == controlId) //see if the current control is a match
                            {
                                  return controls[counter];
                            }
                            else if (controls[counter].Controls.Count > 0) // check the child controls
                            {
    System.Web.UI.Control FoundControl = FindControl(controlId, controls[counter].Controls); // recursive call to check child controls
                                  if (FoundControl != null) // control found in child's controls
                                  {
                                        return FoundControl;
                                  }
                            }
                      }
                      return null;
                }

    魔兽就是毒瘤,大家千万不要玩。
  • 相关阅读:
    kettle7.0数据库迁移(MySQL迁移到Postgresql,迁移过程中自动创建表结构)
    正向代理与反向代理区别
    MySQL存储引擎相关知识点
    设计模式-装饰器模式
    设计模式-策略模式
    算法—数据结构学习笔记(二)栈
    Spring Boot2.0学习笔记(一)
    关联容器——map
    迭代器
    C风格字符串
  • 原文地址:https://www.cnblogs.com/tracy/p/1809159.html
Copyright © 2011-2022 走看看