zoukankan      html  css  js  c++  java
  • 动态添加自定义控件

    <asp:PlaceHolder ID="ph" runat="server"></asp:PlaceHolder>

      string sql= "select Id,Name from Class where ParentId=0";
            DataSet ds = help.Query(sql);
            if (ds != null)
            {
                DataTable dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    for (var i = 0; i < dt.Rows.Count; i++)
                    {
                        Control trol = LoadControl("Class.ascx");
                        Type atype = trol .GetType();
                        System.Reflection.PropertyInfo dd = atype.GetProperty("BigId");
                        dd.SetValue(trol , dt.Rows[i]["Id"], null);
                        ph.Controls.Add(trol);
                    }
                  
                }
            } 

  • 相关阅读:
    6 、 图论—NP 搜索
    5 、 数值计算
    4 、 数论
    3 、 结构
    2 、 组合
    1 、 几何
    Dikstra 堆优化板子
    SPFA板子
    C++优先队列例子
    一些类使用的模板
  • 原文地址:https://www.cnblogs.com/smallfa/p/1604273.html
Copyright © 2011-2022 走看看