动态加入控件的方法

protected System.Web.UI.WebControls.PlaceHolder divModuleContent;
 
  private void Page_Load(object sender, System.EventArgs e)
  {
   string strModuleCode = Request.Params.Get("Module");
   if (strModuleCode != null && strModuleCode.Length > 0)
   {
    this.divModuleContent.Controls.Add(Page.LoadControl(String.Concat(strModuleCode, ".ascx")));
   }
  }
原文地址:https://www.cnblogs.com/wzyexf/p/365922.html