Following is my code
-- the .aspx file
<div id="testDiv" runat="server"></div>
-- the .aspx.cs file
Literal lit1 = new Literal();
lit1.Text = "<table class='allocTable'>";
lit1.Text += "<tr><td><input type='text' runat='server' id='testbox1'></input></td></tr>";
... some other controls <tr><td>...
lit1.Text += "</table>"
testDiv.Controls.Add(lit1);
Now how can I find testbox1 in the .aspx.cs file? I have used FindControl on testDiv and the placeHolder but it returns null.
It seems the textboxes have not been added to the page control but they have just been rendered.