错误的解决方案无法将'System.Web.UI.WebControls.GridView'类型的对象强制转换为'System.Web.UI.WebControls.LinkButton'。在asp.net中 [英] solution of error Unable to cast object of type 'System.Web.UI.WebControls.GridView' to type 'System.Web.UI.WebControls.LinkButton'. in asp.net
本文介绍了错误的解决方案无法将'System.Web.UI.WebControls.GridView'类型的对象强制转换为'System.Web.UI.WebControls.LinkButton'。在asp.net中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我点击下一页时,出现了有问题的错误..
plz建议我为什么在GridView1_RowCommand事件上发生此错误..
when I click on next page, error specified in question is occured..
plz suggest me why this error is occured on GridView1_RowCommand event..
推荐答案
因为您在GridView1_RowCommand
中编写了错误的代码(并且您没有向我们展示该代码,因此我们无法将您指向特定的行!)。 />
AGridView
不是LinkButton
,也不是LinkButton
继承自GridView
,因此无法进行强制转换。
Because you wrote wrong code inGridView1_RowCommand
(and you did not show us that code, hence we cannot point you to the specific line!).
AGridView
is not aLinkButton
, nor doesLinkButton
inherit fromGridView
, consequently that cast is not possible.
这篇关于错误的解决方案无法将'System.Web.UI.WebControls.GridView'类型的对象强制转换为'System.Web.UI.WebControls.LinkButton'。在asp.net中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文