行 53: {行 54: string Memberid = this.GridView1.DataKeys[e.RowIndex][0].ToString();
行 55: string MemberName =(TextBox)this.GridView1.Rows[e.RowIndex].Cells[0].Controls[0].Text.ToString();
行 56: string MemberPass = (TextBox)this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0].Text.ToString();
行 57: string Email = (TextBox)this.GridView1.Rows[e.RowIndex].Cells[2].Controls[0].Text.ToString();
在调试GridView的编辑项时有这个错误不知道要怎么改,一直改不出来
2 回答

缥缈止盈
TA贡献2041条经验 获得超4个赞
你用的是
this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0]的Text,这个是System.Web.UI.Control,没有Text属性。
应该是这样 :
(GridView1.Rows[e.RowIndex].Cells[1].Controls[0] as TextBox) .Text

翻过高山走不出你
TA贡献1875条经验 获得超3个赞
((TextBox)this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text.ToString()
- 2 回答
- 0 关注
- 703 浏览
添加回答
举报
0/150
提交
取消