How to append a WebControl immediately after a WebControl in CodeBehind
<p>Now that i've been MVCing for quite sometime i decide to pop some classic C# .Net into my 8 track and have gotten the following issue:</p>

<p>I have a TextBox WebControl on my aspx page that in the code behind i want to simply append a LiteralControl after it.</p>

<p>This doesn't work:</p>

<pre><code>TextBoxAge.Controls.Add(new LiteralControl("Invalid Age."));
</code></pre>

<p>This works but all the way at the bottom:</p>

<pre><code>TextBoxAge.Controls.Parent.Add(new LiteralControl("Invalid Age."));
</code></pre>

<p>Can you help me!?</p>

<p>For example the HTML will show: </p>

<pre><code>&lt;div&gt;
&lt;input name="TextBoxAge" type="text" id="TextBoxAge" class="Age"&gt;
Invalid Age.
&lt;/div&gt;
</code></pre>

<p>This should be purely dynamic and relative to the control at hand.</p>

<p><strong>Solution:</strong></p>

<pre><code>TextBoxAge.Parent.Controls.AddAt(TextBoxAge.Parent.Controls.IndexOf(T‌​extBoxAge),new LiteralControl("&lt;span&gt;Invalid Age.&lt;/span&gt;"));
</code></pre>
