<p>I have a repeater that is bound to some data.</p>

<p>I bind to the <strong>ItemDataBound</strong> event, and I am attempting to <strong>programmatically</strong> create a <strong>UserControl</strong>:</p>

<p>In a nutshell:</p>

<pre><code>void rptrTaskList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    CCTask task = (CCTask)e.Item.DataItem;

    if (task is ExecTask)
    {
        ExecTaskControl foo = new ExecTaskControl();
        e.Item.Controls.Add(foo);
    }
}
</code></pre>

<p>The problem is that while the binding works, the user control is not rendered to the main page.</p>

Eh, figured out one way to do it:
```
```
ExecTaskControl foo = (ExecTaskControl)LoadControl("tasks\\ExecTaskControl.ascx");
```
```
It seems silly to have a file depedancy like that, but maybe thats how UserControls must be done.