Frankwangyifang

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
 if (this.TextBox1.Text.Trim() != "")
        {
            int len = int.Parse(this.TextBox1.Text.Trim());
            for (int i = 0; i < len; i++)
            {
                TableCell tc = new TableCell();
                TableCell tc2 = new TableCell();
                TextBox txt = new TextBox();
                txt.ID = "txt" + i.ToString();
                LiteralControl lc = new LiteralControl("<input id='Button2' type='button' value='button' onclick=javascript:fun('"+txt.ID+"') />");
                tc.Controls.Add(txt);
                tc2.Controls.Add(lc);
                TableRow tr = new TableRow();
                tr.Cells.Add(tc);
                tr.Cells.Add(tc2);
                this.Table1.Rows.Add(tr);
            }
        }
posted on 2009-11-10 13:00  Frankwangyifang  阅读(238)  评论(0编辑  收藏  举报