如题请问生成表格的同时在表格中产生textbox。生成表格是按编程方式产生的。 我只做得出来给出行和列 产生表格。。无法在表格中再加入textbox求教!我的代码如下
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class table : System.Web.UI.Page
{    protected void button1_Click(object sender, EventArgs e)
    {
        int numr= int.Parse(ListBox1.SelectedItem.Value);
        int numd= int.Parse(DropDown1.SelectedItem.Value);
        for (int i = 0; i < numr; i++)
        {
            TableRow r = new TableRow();
            for (int j = 0; j < numd; j++)
            {
                TableCell c = new TableCell();
                TextBox B = new TextBox(); 这行不对 只是在添加text里想的。想到这里 不知道对不对,求教
                c.Controls.Add(new LiteralControl("行" + i.ToString() + ", 列" + j.ToString()));
                r.Cells.Add(c);
            }            table1.Rows.Add(r);
        }
    }
}
其中用了listbox和dropdwon2个控件 。