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

相关文章:

  • 2021-12-14
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-10-02
相关资源
相似解决方案