The TargetControlID is not valid / adding a control to a form in the asp.net code
<p>I am trying to add a control that I define in C# to my asp code, by doing this in my code:</p>

<pre><code>&lt;% this.Controls.Add(blah.GetControl()); %&gt;
</code></pre>

<p>but I get the error: The TargetControlID of 'a8f08c40d0fab104ca20b1460ee1cbdd1e121' is not valid. The value cannot be null or empty.</p>

<p>Thats the controls GUID that I randomly generate in the get method.</p>

<p>Any explanation as to why I am getting it? Is what I am doing even allowed - putting that code above into my aspx file?</p>

<p>Edit: Additional code for the new ID problem:</p>

<pre><code>.
.
    &lt;div id="divDetailsContent" style="width:100%"&gt;
.
.
&lt;% this.Controls.Add(blah.GetControl("divDetailsContent")); %&gt;
.
.
public static blah GetControl(n)
{
.
.
blah.TargetID = n;
.
.
}
</code></pre>
