HtmlControl disappears on postback when adding other controls on index and hiding another control
<p>I ran in to the strangest .NET bug I've ever seen yet. The following code is the absolute minimum required to recreate this behaviour. It happens on both ASP.NET 4 and 3.5 (haven't tested earlier versions).</p>

<p>The .aspx file:</p>

<pre><code>&lt;form id="form1" runat="server"&gt;
  &lt;div id="mainContent" runat="server"&gt;
    &lt;input type="submit" /&gt;
    &lt;div id="dvWantToBeRemoved" runat="server"&gt;&lt;p&gt;This should never be visible&lt;/p&gt;&lt;/div&gt;
    &lt;div id="dvDisappears" runat="server"&gt;&lt;p&gt;THIS SHOULD BE VISIBLE&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>Codebehind:</p>

<pre><code>Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  mainContent.Controls.AddAt(0, New LiteralControl("&lt;h1&gt;Adding one control&lt;/h1&gt;"))
  mainContent.Controls.AddAt(1, New LiteralControl("&lt;h1&gt;Adding another control&lt;/h1&gt;"))
  dvWantToBeRemoved.Visible = False
End Sub
</code></pre>

<p><em>Expected behaviour:</em>
The div called dvWantToBeRemoved should never be rendered to the page. The div called dvDisappears should always be visible.</p>

<p><em>Actual behaviour:</em>
The div called dvDisappears is removed from the page. </p>

<p>Can anyone explain to me what is going on here? My first thought was that the reference to dvWantToBeRemoved was somehow lost, but inspecting its' .InnerHtml indicates that this is not the case... </p>
