dim htmltr as tablerow
dim htmltd as tablecell
dim lblUser as new label
dim txtUser as new textboxhtmltr=new tablerow
htmltd=new tablecell
htmltd.controls.add(lblUser)
htmltd.controls.add(txtUser)
htmltr.cell.add(htmltd)
Table.row.add(htmltr)
dim htmltd as tablecell
dim lblUser as new label
dim txtUser as new textboxhtmltr=new tablerow
htmltd=new tablecell
htmltd.controls.add(lblUser)
htmltd.controls.add(txtUser)
htmltr.cell.add(htmltd)
Table.row.add(htmltr)
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
TableCell c1 = new TableCell();
TableCell c2 = new TableCell();
Label1.Text = table.Rows[j]["Name"].ToString();
c1.Controls.Add(Label1);
c2.Controls.Add(TextBox1);
r.Cells.Add(c1);
}我想知道怎么访问TextBox1的内容,如果我用 Table1.Rows[i].Cells[1].ToString()是不行的,多谢
r.Cells.Add(c2);
Table1.Rows.Add(r);
}
Label1.ID = "MyLabel"
Table1.Controls.Add(Label1);//回发时先要执行上面的代码,否则会找不到
string getValue = ( ( Label )Table1.FindControl("MyLabel") ).Text;