asp,c#,GridView编辑更新是报错

图片说明无法将类型为“System.Web.UI.WebControls.DataControlLinkButton”的对象强制转换为类型“System.Web.UI.WebControls.TextBox”。

![图片说明](https://img-ask.csdn.net/upload/201803/17/1521222095_418178.png)图片说明
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//取得编辑行的关键字段的值
string ID = GridView1.DataKeys[e.RowIndex].Value.ToString();
//取得文本框中输入的内容
string id = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString();
string name = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString();
string price = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString();
string comment = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString();
string picture = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString();
string type = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].Controls[0])).Text.ToString();
string identify = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString();
string introduce = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[8].Controls[0])).Text.ToString();
string pic1 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[9].Controls[0])).Text.ToString();
string pic2 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[10].Controls[0])).Text.ToString();
string pic3 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[11].Controls[0])).Text.ToString();
string pic4 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[12].Controls[0])).Text.ToString();
string pic5 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[13].Controls[0])).Text.ToString();

请大神帮帮忙

犯了一个错误。
你是web的。。

把你的页面和代码贴出来看看。。。

看一下你的构造函数(查找Columns.AddRange)。

看一下GridView1创建列的时候。是否都是DataGridViewTextBoxColumn。

是否存在DataGridViewLinkColumn。

没有看到你的源码,所以无法确定你的问题。

我这两个都没有,这要怎么加上的,菜鸟一个,希望可以多加指导,谢谢了!

把Columns.AddRange里面的代码贴出来。

你看下你的Cells[1]是什么控件,看你的贴图,应该是个linkbutton啊,你这句string id = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString();检查下是不是将linkbutton转化成textbox了,那么是要报错了。