Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdatePanels in a UserControl Loaded through LoadControl() don't work?
    text
    copied!<p>I hope you can help as i've been banging my head against the wall for a while. Long story short, I want to dynamically load UserControls with LoadControl which contain their own updatepanels, and when they're on the page, be able to trigger their updates individually via their children.</p> <p>To explain better, see my extremely simplified example of my issue:</p> <p><strong>Default.aspx</strong></p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;div&gt; &lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&gt;&lt;/asp:PlaceHolder&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p><strong>Default.aspx.vb</strong></p> <pre><code> IF Me.IsPostBack = False Dim control As Control = LoadControl("WebUserControl.ascx") PlaceHolder1.Controls.Add(control) Dim control2 As Control = LoadControl("WebUserControl.ascx") PlaceHolder1.Controls.Add(control2) Dim control3 As Control = LoadControl("WebUserControl.ascx") PlaceHolder1.Controls.Add(control3) End If </code></pre> <p><strong>WebUserControl.ascx</strong></p> <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"&gt; &lt;ContentTemplate&gt; &lt;%= Now.ToLongTimeString%&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; &lt;/ContentTemplate&gt; </code></pre> <p></p> <p>If you ran this, i would like each control to be loaded, added to the placeholder, and then when you click the button in that control, only that control trigger an update.</p> <p>Instead it doesn't seem to work.</p> <p>If i add the controls to the page by using the usual tags, they work fine, so the issue is somewhere in the loadControl/placeholder issue.</p> <p><strong>PLEASE HELP!</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload