当前位置: 代码迷 >> ASP.NET >> gridview在更新的时候无法得到值解决办法
  详细解决方案

gridview在更新的时候无法得到值解决办法

热度:5795   发布时间:2013-02-25 00:00:00.0
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
}
}
  相关解决方案