Hey Buddy,
Did you notice that all your dynamically produced textboxes have the same id ? Ideally all controls in a web form should have unique id. If you try to assign unique id dynamically from aspx page, then it's not going to happen.
My suggestions:
1.) Remove this code from aspx page:
<%for (int i = 0; i <= 6; i++)
{%>
<asp:TextBox ID="tb" class="form-control" runat="server"></asp:TextBox>
<%} %>
2.) Add below code in your code behind:
for (int i = 0; i <= 6; i++)
{
TextBox tb = new TextBox();
tb.ID = "tb" + i.ToString();
tb.Attributes.Add("class", "form-control");
Panel1.Controls.Add(tb);
}
Voila , Now this works.