日期:2014-05-18  浏览次数:20497 次

gridview在更新的时候无法得到值
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
  string titname = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBoxName")).Text;
   
  Response.Write(titname);
   
  }

我用的是模板绑定的数据,编辑模板中有TextBox,他的id是TextBoxName,在编辑状态下我往textbox中输入一个值,单击更新后还是原来的值,我输入的新值不显示,是什么原因呀,请大家指点,谢谢了!!

------解决方案--------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
在这里面绑定GridView
}
}