• 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;
                }

    魔兽就是毒瘤,大家千万不要玩。
  • 相关阅读:
    记录nginx 搭建集群环境踏过的坑
    工作中常见问题
    自定义WebViewPage,实现Url.Action生成绝对地址
    上传阿里云样式文件不解析问题一例总结
    EF4.4 升级EF6.0问题总结
    记一次数据库迁移遇到问题
    javascript 中 !~ 什么意思
    jquery.mobile 中 collapsible-set collapsible listview 共同布局问题
    T-sql脚本规范
    EasyUI使用技巧总结
  • 原文地址:https://www.cnblogs.com/tracy/p/1809159.html
Copyright © 2020-2023  润新知