初学者的困惑

lindanhuayatou 2012-06-01 02:56:11
CS1061: “ASP.usermain_aspx”不包含“GridView1_RowCommand”的定义,并且找不到可接受类型为“ASP.usermain_aspx”的第一个参数的扩展方法“GridView1_RowCommand”(是否缺少 using 指令或程序集引用?)

源错误:
style="color: #990000; font-size: large"></asp:Label>
行 49: <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
行 50: DataKeyNames="bookID" DataSourceID="SqlDataSource1" OnRowCommand="GridView1_RowCommand"
行 51: PageSize="3" Width="773px" Height="428px">
初学者,不懂在哪里定义,怎么定义,求助,求助
...全文
202 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
牛哥_ 2012-06-02
  • 打赏
  • 举报
回复
老是 copy 自己好好写一次代码不行吗?
lindanhuayatou 2012-06-02
  • 打赏
  • 举报
回复
不是哈,本人不是专业程序员,只不过是一次作业,,没办法,求助各位哈,谢谢喽
IT-Style 2012-06-02
  • 打赏
  • 举报
回复
胶水程序员
tears_tjy 2012-06-01
  • 打赏
  • 举报
回复
把 OnRowCommand="GridView1_RowCommand" 删掉
sglogin 2012-06-01
  • 打赏
  • 举报
回复
其实这么用是有点初级
sglogin 2012-06-01
  • 打赏
  • 举报
回复
DataSourceID="SqlDataSource1"也删掉,或者你增加一个同名的数据源
zhangdaowu5 2012-06-01
  • 打赏
  • 举报
回复
在你的aspx.cs后置页面中去看一下有没有生产GridView1_RowCommand这个事件,要保持前置页面和后置页面的事件一致,仔细看看有没有。
lindanhuayatou 2012-06-01
  • 打赏
  • 举报
回复
我自己进行定义后,现在出现了GridView1”的 DataSourceID 必须是 IDataSource 类型的控件的 ID。未能找到 ID 为“SqlDataSource1”的控件。这样的问题怎么解决。
lindanhuayatou 2012-06-01
  • 打赏
  • 举报
回复
怎么对OnRowCommand="GridView1_RowCommand进行定义,因为他出现没有定义的字眼的错误,要在后台定义吗,如果不想删掉的话。
E次奥 2012-06-01
  • 打赏
  • 举报
回复
你后台没有“GridView1_RowCommand”事件。你的代码貌似是Copy的,删掉OnRowCommand="GridView1_RowCommand" 就不报错了!@
xiedwxy0625 2012-06-01
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

删掉就把什么都没了
[/Quote]

什么意思??
lindanhuayatou 2012-06-01
  • 打赏
  • 举报
回复
删掉就把什么都没了
牛哥_ 2012-06-01
  • 打赏
  • 举报
回复
抄袭的吧 你把那个事件删了就行了
billlyh 2012-06-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
OnRowCommand="GridView1_RowCommand" 删掉
[/Quote]
正解
bonnibell 2012-06-01
  • 打赏
  • 举报
回复
OnRowCommand="GridView1_RowCommand" 删掉

62,268

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧