日期:2014-05-19  浏览次数:20431 次

GridView1更新去值问题
protected   void   gdvCityShow_RowUpdating(object   sender,   GridViewUpdateEventArgs   e)
        {
                int   countID   =   Int32.Parse(this.gdvCityShow.DataKeys[e.RowIndex].Value.ToString());

                GridViewRow   drw   =   gdvCityShow.Rows[e.RowIndex];

                string   str1   =   ((TextBox)drw.Cells[0].Controls[0]).Text.ToString();

……
GridView1为什么我取出的值永远是未更新以前的呢?   更新以后的数据如何取出?
个位大大给点提示吧
最好把代码给我。谢谢

------解决方案--------------------
在page_load中 if(!this.IsPostBack) { //然后绑定. }
------解决方案--------------------
是这样的 你必须得有个datakeys 来确定更新记录的id
------解决方案--------------------
事件不对
------解决方案--------------------
cpp2017(慕白兄) ( ) 信誉:100 Blog 加为好友 2007-4-20 12:37:05 得分: 0



在page_load中


if(!this.IsPostBack)
{
//然后绑定.
}





------解决方案--------------------
http://dotnet.aspx.cc/article/a933b187-06c3-4263-9eec-414a54d9c815/read.aspx