I have a page where I add a dynamic user control in the Page_Load event based on criteria.
The control is a simple form with a save button. The problem is the _Click event never fires for the button. It will postback the main page the control is within, but not the code behind for the control...so I never get the button click even, and therefor can't execute the save code.
Tried it in the init, tried adding the control to a placeholder, tried a lot of various things but nothing seems to work. Any help is greatly appreciated. Just want it to fuction the same as if it wasn't added dynamically. Thanks.
Code:If cb_business_profile.Items.Count = 0 Then Dim u_pnl_content As UpdatePanel = Page.FindControl("u_pnl_content") u_pnl_content.ContentTemplateContainer.Controls.Clear() Dim business_profile_detail As Control = LoadControl("~/controls/business_profile_detail.ascx") business_profile_detail.ID = "business_profile_detail" u_pnl_content.ContentTemplateContainer.Controls.Add(business_profile_detail) u_pnl_content.Update() Else load_dashboard() End If




Reply With Quote