用户控件的动态加载

//Load
UserControl c1 = (UserControl)LoadControl("ucCheckBoxGroup.ascx");
c1.ID 
= "_UserGroups";
//Set Property
Type c1Type = c1.GetType();
System.Reflection.PropertyInfo c1PInfor 
= c1Type.GetProperty("ConnectionString");
c1PInfor.SetValue(c1,strConn, 
null);
//display
//Page.Controls.Add(c1)
C.Controls.Add(c1);


posted @ 2010-08-18 17:07  空紫竹  阅读(187)  评论(0编辑  收藏  举报