编译错误“ImageButton1_Click”;不是“ASP.ae_downloads_”的成员。 [英] Compilation Error "ImageButton1_Click"; is not a member of "ASP.ae_downloads_"

查看:151
本文介绍了编译错误“ImageButton1_Click”;不是“ASP.ae_downloads_”的成员。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器中有/astCalc1/jpg/image.jpg的图像。我在ae_downloads.aspx中使用它。我遇到错误:



I have a image at "/astCalc1/jpg/image.jpg" in my server. I use it in ae_downloads.aspx. I am getting on error:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'ImageButton1_Click' is not a member of 'ASP.ae_downloads_aspx'.

Line 15:     <asp:ImageButton ID="ImageButton1" runat="server" src="../astCalc1/jpg/image.jpg" OnClick="ImageButton1_Click" /></td><td>

推荐答案

此链接可以帮助您..



http://forums.asp.net/t/1333758.aspx [ ^ ]
This link may help you..

http://forums.asp.net/t/1333758.aspx[^]


Refer - '< name>'不是'< classname>'的成员[ ^ ]。

Refer - '<name>' is not a member of '<classname>'[^].
引用:

更正此错误

  1. 检查名称会员以确保其准确无误。

  1. Check the name of the member to ensure it is accurate.

使用班级的实际成员。

< h3>一些要点



  • 确保代码背后的事件存在
  • 确保事件名称与 aspx 中声明的相同,即 ImageButton1_Click
  • 确保事件的 Access Specifier protected public ,而不是 private

    因此, Code Behind 中的事件应该是l喜欢。

    Some points



    • Make sure the Event Exists on Code Behind.
    • Make sure the Event name is the same as declared in aspx that is ImageButton1_Click.
    • Make sure the Access Specifier of the Event is protected or public, not private.
      So, Event in Code Behind should look like.

      protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
      {
          // Do whatever you want to do.
      }




    • 这篇关于编译错误“ImageButton1_Click”;不是“ASP.ae_downloads_”的成员。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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