我在更新GridView的一行数据的时候,提示未将对象的引用设置到对象的实例(第五行)
1.protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
2. {
3. int index = e.RowIndex;
4. int id = Convert.ToInt32(GridView1.Rows[index].Cells[1].Text);
5. string name = ((TextBox)GridView1.Rows[index].Cells[2].FindControl("TextBox1")).Text;
6. int age = Convert.ToInt32(((TextBox)(GridView1.Rows[index].Cells[3].FindControl("TextBox2"))).Text);
7. fill(id, name, age);
8. GridView1.EditIndex = -1;
9. bind();
10. }
1.protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
2. {
3. int index = e.RowIndex;
4. int id = Convert.ToInt32(GridView1.Rows[index].Cells[1].Text);
5. string name = ((TextBox)GridView1.Rows[index].Cells[2].FindControl("TextBox1")).Text;
6. int age = Convert.ToInt32(((TextBox)(GridView1.Rows[index].Cells[3].FindControl("TextBox2"))).Text);
7. fill(id, name, age);
8. GridView1.EditIndex = -1;
9. bind();
10. }
解决方案 »
- Dictionary<string, DataStruct.OnLineUsers> 类型的数据,在socket通信里怎么在字节数组类型之间相互转化?
- 如何用程序设定Server2008里面IIS的ISAPI and CGI
- C#(winform)中有没有文本编辑控件
- C#中ComboBox问题
- 菜鸟问题
- 求怎样得到按下的键是DEL键~~谢谢
- 请问,怎么模拟键盘右手边的CTRL键??
- 删除GridView内容时弹出询问框老是出错,什么原因,谢谢!
- 为什么DataGrid 点编辑按钮后,datagrid消失了
- VS2010老是提示visual studio实时调试器
- 高手指点有关cookie的问题
- C#窗体控件制作成计算机的快捷方式,与计算机应用程序连接
看看,具体的你调试下