Im designing a from with 31 textboxes in a column and the rows can increase to how many ever
like
<table>>
lt;tr>
<td colspan=31>
header
</td>
<tr>
<td><asp:TextBox id=txt1 ...</td>
</tr>
.
.
.
31
I want this to happen dynamically, when a user clicks and add row button
I tried using a literal control to include text
like
<table>>
lt;tr>
<td colspan=31>
header
</td>
<tr>
<td><asp:Literal ...</td>
</tr>
and
Literal1.Text += "" // html code for whole row
From what I understand you cannot include txtboxes in literal cause it can't have child controls so I used a
PlaceHolder in place of a literal
on a button
addrow_click()<br />
{<br />
TextBox t1 = new TextBox();<br />
Literal l1 = new Literal();<br />
l1.Text="test";<br />
PlaceHolder1.Controls.Add(l1);<br />
PlaceHolder1.Controls.Add(l2);<br />
}<br />
<br />
This does add something to the form but not in the tabular format
and when I click the addrow button another time, the old controls (literal and textbox) are removed and a new one is added in place of that.
I want a new row to be added after the existing row can do this with one PlaceHolder ?
and How do I add a whole as shown above (with 31 textboxes) to the PlaceHolder in a tabular form?