locked
Events of UserControl doesn't fired RRS feed

  • Question

  • User769990957 posted

    There is a UserControl (id="ChildControl"). When it loaded by LoadControl method and added to the PlaceHolder on  the page, everything works fine. But if these same acts done within another UserControl (id="ParentControl") and   ChildControl added in PlaceHolder of ParentControl and then   ParentControl added on a page, there is not works ChildControl's  events (Page_Init / Load / PreRender). All controls are displayed correctly in browser after compiling. I tried to connect the event handlers dynamically in the OnInit, but  this did not help (debugger doesn't stops on breakpoint in OnInit):

    public partial class СhildControl : System.Web.UI.UserControl
    {
    .........

    protected override void OnInit(EventArgs e)
    {
    base.OnInit(e);
    this.Load += new System.EventHandler(this.Page_Load);


    }
    ............
    }

    Friday, April 17, 2009 6:54 AM

Answers

  • User-518513732 posted

     Events of the user control are not bubbled in your case.

    What u can do is Instead of adding user control in the placeholder use repeater control......

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 17, 2009 9:07 AM