动态添加用户控件,并且赋值

UserControl uc= (UserControl)  this.LoadControl("WebUserControl1.ascx");
         ((Label)uc.FindControl("Label1")).Text= "111";
 
            this.Page.Controls.Add(uc);


   本人博客的文章大部分来自网络转载,因为时间的关系,没有写明转载出处和作者。所以在些郑重的说明:文章只限交流,版权归作者。谢谢

原文地址:https://www.cnblogs.com/wzg0319/p/1820839.html