首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-02-13 
gridview在更新的时候无法得到值protected void GridView1_RowUpdating(object sender, GridViewUpdateEve

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
}
}

热点排行