哈哈,我昨天刚解决了这个问题
写个函数
private void AddRow()
{

TableRow tr1 = new TableRow();
TableCell td1 = new TableCell();
TableCell td2 = new TableCell();

TextBox txtXx = new TextBox();
TextBox txtXs = new TextBox();

td1.Controls.Add(txtXx);
td2.Controls.Add(txtXs);

tr1.Cells.Add( td1 );
tr1.Cells.Add( td2 );

tabInput.Rows.Add( tr1 );

}
然后在page_load中加入
if ( ViewState["Count"] != null )
{
for(int l=0;l<int.Parse( ViewState["Count"].ToString() )+1;l++)
{
AddRow();
}
}
在按钮的响应函数中加入
if ( ViewState["Count"] == null )
{
ViewState["Count"] = 0;
}
else
{
ViewState["Count"] = int.Parse( ViewState["Count"].ToString() ) + 1;
} AddRow();