Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing TabContainer OnDemand feature to lazy load UserControl, when to perform work?
    primarykey
    data
    text
    <p>I'm trying out the OnDemand feature of the ASP.NET Ajax Control Toolkit TabContainer to delay execution of expensive operations until the tab is loaded.</p> <p>On my page there are a few tabs, and each tab's content consists of a single user control</p> <pre><code>&lt;ajaxToolkit:TabContainer ID="TabContainer1" ActiveTabIndex="0" OnDemand="True" runat="server"&gt; &lt;ajaxToolkit:TabPanel ID="TabPanel1" HeaderText="tab 1" runat="server" &gt; &lt;ContentTemplate&gt; &lt;UC:Tab1 runat="server" /&gt; &lt;/ContentTemplate&gt; &lt;/ajaxToolkit:TabPanel&gt; &lt;ajaxToolkit:TabPanel ID="TabPanel2" HeaderText="tab 2" runat="server"&gt; &lt;ContentTemplate&gt; &lt;UC:Tab2 runat="server" /&gt; &lt;/ContentTemplate&gt; &lt;/ajaxToolkit:TabPanel&gt; &lt;/ajaxToolkit:TabContainer&gt; </code></pre> <p>Each of these user controls is then wired up to a presenter with a custom MVP framework I inherited. The presenter is executed in OnLoad</p> <pre><code>// In user control protected override void OnLoad(EventArgs e) { base.OnLoad(e); presenter.BuildView(); // this is what I want to delay until the tab is active } </code></pre> <p>Since OnLoad is always called, regardless of the tab being active, I know it's the appropriate event to attach to. What is the proper event to attach to, so that I can achieve the same effect as the <a href="http://stephenwalther.com/archive/2011/11/16/ajax-control-toolkit-november-2011-release.aspx" rel="nofollow">example provided here</a> with the SqlDataSource's selecting event only firing when the tab is loaded.</p> <p>Maybe override Render? Or CreateChildControls?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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