C# aspx页面动态加载ascx用户控件

    protected void Page_Load(object sender, EventArgs e)
    {
        Control a = Page.LoadControl("WebUserControl.ascx");
        a.ID = "WebUserControl";
        this.Page.Controls.Add(a);
    }

posted @ 2009-05-31 14:05  起源  阅读(631)  评论(1编辑  收藏  举报