先在.aspx页中加页指命:<%@ Reference Control="UserControls/NewContent.ascx"%>
在.aspx.cs后置文件中引用户名字空间:using WebUI.UserControls;
使用户Load方法加载控件:
UserControl nContent = (UserControl)this.LoadControl("UserControls/NewContent.ascx");
((NewContent)nContent).NewTypeId = strId[i].ToString();
this.Panel1.Controls.Add(nContent);