views:

458

answers:

0

Hey all! I'm loading a UserControl through a Web Method, and using the LoadControl functionality as such:

// create page, stringWriter
    Page _page = new Page();
    StringWriter _writer = new StringWriter();

    // get popup control
    Controls_Popup_ForumThreadForm _control = _page.LoadControl("~/Controls/Popup_ForumThreadForm.ascx") as Controls_Popup_ForumThreadForm;

Then I do the following:

// add control to page
    _page.Controls.Add(_control);

    HttpContext.Current.Server.Execute(_page, _writer, false);

Problem is that the Page_Load event of the control doesn't fire at all. If I add another function, and call it prior to adding the control to the Controls collection of the page, that function will fire, but the Page_Load event will not fire.

Any ideas, fellas? Thanks all!