如何纠正按钮在网格视图中单击错误 [英] How rectify the button click Error in Grid view

查看:89
本文介绍了如何纠正按钮在网格视图中单击错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器错误消息:CS1061:

源错误:

第34行:
第35行:TotalMarks:< asp:标签ID ="lbltotal" align ="right" runat ="server">
第36行:< asp:Button ID ="Button1" runat ="server" onclick ="Button1_Click" Text ="Button"/>
第37行:
第38行:</form>

我在这条线有错误.在gridview按钮中
< asp:Button ID ="Button1" runat ="server" onclick ="Button1_Click" Text ="Button"/>

感谢您的宝贵重放.

Compiler Error Message: CS1061:

Source Error:

Line 34:
Line 35: TotalMarks:<asp:Label ID="lbltotal" align="right" runat="server">
Line 36: <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
Line 37:
Line 38: </form>

i got error in this line. in gridview button
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

thank for your valuable replay

推荐答案

当您尝试调用方法或访问不存在的类成员时,会发生此错误.
看到这个
http://msdn.microsoft.com/en-us/library/bb383961.aspx [ ^ ]

.cs文件中是否有按钮单击事件
This error occurs when you try to call a method or access a class member that does not exist.

See this
http://msdn.microsoft.com/en-us/library/bb383961.aspx[^]

do you have button click event in .cs file


请参阅:

http://forums.asp.net/p/1384530/3604935.aspx [ ^ ]

一旦检查,您是否有按钮单击事件

否则,请删除您的按钮并再次创建
Refer this:

http://forums.asp.net/p/1384530/3604935.aspx[^]

Once check you have button click event or not

Or else remove your button and create again


删除按钮"Button1",然后在页面上添加一个新按钮.

如果要添加click事件,请双击设计面板上的按钮,然后onclick事件将出现在.cs文件中.

发生错误的原因可能是.CS页中没有Button1_Click事件
Remove the button "Button1", then add a new one to the page.

If you want to add the click event, please double click the button on the design panel, then the onclick event will appear in the .cs file.

The error happen may be because Button1_Click event not exist in .CS page


这篇关于如何纠正按钮在网格视图中单击错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆