Reducing usage of recursive Page.FindControl using a control manager -- not sure if this is possible?
<p>I have controls being dynamically added and recreated on a web dashboard. I have been attempting to reduce my usage of Page.FindControl; I found it to be slow with large amounts of dynamically created content on Page.</p>

<p>In my attempts, I created a RegenerationManager singleton which is now in charge of regenerating my dynamic content. Whenever it regenerates an object, it stores the object in a list. This manager keeps several of these lists based on type of object.</p>

<p>Later, when I need to fetch an object by ID, I go to my regeneration manager to retrieve the object.</p>

<p>E.G:</p>

<pre><code>public class RegenerationManager
{
    private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

    private static readonly RegenerationManager instance = new RegenerationManager();
    private RegenerationManager() { }

    public static RegenerationManager Instance
    {
        get { return instance; }
    }

    public List&lt;CormantRadPane&gt; RegeneratedPanes = new List&lt;CormantRadPane&gt;();
    public List&lt;CormantRadDockZone&gt; RegeneratedDockZones = new List&lt;CormantRadDockZone&gt;();

    /// &lt;summary&gt;
    /// Recreates all the dynamically made DockZones.
    /// &lt;/summary&gt;
    public void RegenerateDockZones()
    {
        Logger.Info("Regenerating dock zones.");
        foreach (KeyValuePair&lt;string, RadDockZoneSetting&gt; dockZoneState in RadControlManager.GetStates&lt;SerializableDictionary&lt;string, RadDockZoneSetting&gt;&gt;())
        {
            try
            {
                RadDockZoneSetting dockZoneSetting = dockZoneState.Value as RadDockZoneSetting;
                Logger.Info(String.Format("Loading state data for dock zone with setting ID: {0}", dockZoneSetting.ID));
                CormantRadDockZone dockZone = new CormantRadDockZone(dockZoneSetting);
                RegeneratedDockZones.Add(dockZone);
                CormantRadPane pane = RegeneratedPanes.First(regeneratedPane =&gt; regeneratedPane.ID == dockZoneSetting.ParentID);
                pane.Controls.Add(dockZone);
            }
            catch (Exception exception)
            {
                Logger.ErrorFormat("Error regenerating dock zones. Reason: {0}", exception.Message);
            }
        }
    }
}

/// &lt;summary&gt;
/// Creates the RadDock + Contents when dropping a graph onto the page.
/// &lt;/summary&gt;
/// &lt;param name="sender"&gt; The RadListBox with an element being dropped from inside it. &lt;/param&gt;
/// &lt;param name="e"&gt; Information about the drop such as target and what is being dropped. &lt;/param&gt;
protected void RadListBox_Dropped(object sender, RadListBoxDroppedEventArgs e)
{
    CormantRadDockZone dockZoneOld = Utilities.FindControlRecursive(Page, e.HtmlElementID) as CormantRadDockZone;
    CormantRadDockZone dockZone = RegenerationManager.Instance.RegeneratedDockZones.First(regeneratedDockZone =&gt; regeneratedDockZone.ID == e.HtmlElementID);

    if (!object.Equals(dockZone, null) &amp;&amp; !dockZone.Docks.Any())
    {
        RadSlidingPane slidingPane = ((sender as RadListBox).Parent as RadSlidingPane);
        CormantReport report = new CormantReport(int.Parse(e.SourceDragItems[0].Value), e.SourceDragItems[0].Text, slidingPane.Title);
        CormantRadDock dock = new CormantRadDock(report);
        dock.CreateContent();
        dockZone.Controls.Add(dock);
    }
}
</code></pre>

<p>Now, I thought this was a pretty good solution, but upon testing I found that the CormantRadDock being added to dockZone does not show up on my web dashboard, but if I added it to dockZoneOld that it does.</p>

<p>Looking at the two objects I did not notice any properties different about the two, but obviously there is something.</p>

<p>Is my idea possible to implement?</p>

<p>EDIT: I suspect the problem is with Telerik's controls. I have an idea I'll report back in a bit.
EDIT: It was indeed a Telerik thing. I needed to go through their RadDockLayout.RegisteredDockZone's list instead of keeping my own managed one.</p>
