是这样的。现在用Table直接显示数据库中的数据,当用户点击一行数据时,本行数据中的单元格中的内容变为 文本框,以便用户能改修改数据。
现在的问题是,当用户点击编辑一行时。我用如下代码写入文本框(仅以修改一个字段为例)//Lid 是一行数据的主键。
//("Line" + Lid.ToString() 是前面已经定义好的行IDTableCell temp_cell = (this.FindControl("Line" + Lid.ToString()) as TableRow).Cells[1];  TextBox temp_tb = new TextBox();
  temp_tb.ID = "temp_pdm" + Lid.ToString();
  temp_tb.Width = 65;
  temp_tb.Text = "...";
  temp_cell.Controls.Add(temp_tb);用户修改完成后点击 确认 后用
TableRow temp_tr = (this.FindControl("Line" + Lid.ToString()) as TableRow);TextBox tb = (TextBox)temp_tr.Cells[1].FindControl("temp_pdm" + Lid.ToString());

TextBox tb = (temp_tr.Cells[1].FindControl("temp_pdm" + Lid.ToString() as TextBox);中不到数据。
请高手指教,谢谢