The TargetControlID of 'CalendarExtender1' is not valid. A control with ID 'text1' could not be found
<p>I have created the Textbox and using CalendarExtener dynamically. I am getting the error"The TargetControlID of 'CalendarExtender1' is not valid. A control with ID 'text1' could not be found."</p>

<p>The below is my code</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        TextBox tb = new TextBox();
        tb.ID = "text1";
        AjaxControlToolkit.CalendarExtender publishdate = new AjaxControlToolkit.CalendarExtender();
        publishdate.ID = "CalendarExtender1";
        publishdate.TargetControlID = tb.ID;
        Panel1.Controls.Add(publishdate);
    }
</code></pre>
