为了账号安全,请及时绑定邮箱和手机立即绑定

CS1061: “System.Web.UI.Control”不包含“Text”的定义,并且找不到可接受类型为“System.Web.UI.Control”的第一个参数的扩展方法“Text”(是否缺少 using 指令或程序集引用?)

CS1061: “System.Web.UI.Control”不包含“Text”的定义,并且找不到可接受类型为“System.Web.UI.Control”的第一个参数的扩展方法“Text”(是否缺少 using 指令或程序集引用?)

开心每一天1111 2018-12-07 01:44:48
  行 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

查看完整回答
反对 回复 2019-01-21
?
翻过高山走不出你

TA贡献1875条经验 获得超3个赞

((TextBox)this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text.ToString()

查看完整回答
反对 回复 2019-01-21
  • 2 回答
  • 0 关注
  • 703 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号