其實(shí),我創(chuàng)建1 TextBox上Pageload,并補(bǔ)充說TextBox來Panel。現(xiàn)在,我有一個(gè)LinkButton喜歡Add Another。我正在輸入文本,TextBox如果需要,我需要TextBox通過單擊創(chuàng)建新建Add Another LinkButton。實(shí)際上,我能夠得到計(jì)數(shù)并重新創(chuàng)建TextBoxes。但是,問題在于,先前生成的我輸入的文本Textboxes是丟失的。任何人,建議我這個(gè)解決方案?protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { for (int i = 0; i < 5; i++) { TableRow row = new TableRow(); for (int j = 0; j < 5; j++) { TableCell cell = new TableCell(); TextBox tb = new TextBox(); tb.ID = "TextBoxRow_" + i + "Col_" + j; cell.Controls.Add(tb); row.Cells.Add(cell); } Table1.Rows.Add(row); } } } catch (Exception ex) { throw; } }這是一個(gè)示例代碼,同樣的代碼寫在Button_Click另外 protected void ASPxButton1_Click(object sender, EventArgs e) { int k = Table1.Controls.Count;}我得到一個(gè)Count=0上Button_Click。
動態(tài)創(chuàng)建控件在回發(fā)后丟失數(shù)據(jù)
繁華開滿天機(jī)
2019-09-03 16:06:56