asp.net user control element is null
<p>I have a simple asp.net user control:</p>

<pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" 
    CodeBehind="QueryDefinitionItem.ascx.cs"
    Inherits="xxx.UserControls.QueryDefinitionItem" %&gt;
    &lt;link href="../Styles/Site.css" rel="stylesheet" type="text/css" /&gt;
    &lt;div class="title"&gt;
      &lt;h1 id="TextField" runat="server"&gt;&lt;/h1&gt;
    &lt;/div&gt;
</code></pre>

<p>Code behind:</p>

<pre><code> public partial class QueryDefinitionItem : System.Web.UI.UserControl
{
    private string m_text;
    protected void Page_Load(object sender, EventArgs e)
    {
        TextField.InnerText = m_text;
    }

    public void SetText(string text)
    {
        m_text = text;
    }
}
</code></pre>

<p>I use LoadControl to load one instance programatically:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        var control = (QueryDefinitionItem)LoadControl(typeof (QueryDefinitionItem),null);
        control.SetText("test2");
        itemsPanel.Controls.Add(control);}
</code></pre>

<p>I then use the SetText function to set the text and once the Page Load is fired I get a NullReferenceException that says TextField is null... </p>

<p>I cant figure out why.</p>
