加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 编译错误 – 与委托没有相同的签名

发布时间:2020-12-16 09:12:55 所属栏目:asp.Net 来源:网络整理
导读:不确定我做错了什么…… BC30408: Method ‘Protected Sub ValidateUser(sender As Object,e As System.EventArgs)’ does not have the same signature as delegate ‘Delegate Sub AuthenticateEventHandler(sender As Object,e As System.Web.UI.WebContr
不确定我做错了什么……

BC30408: Method ‘Protected Sub ValidateUser(sender As Object,e As
System.EventArgs)’ does not have the same signature as delegate
‘Delegate Sub AuthenticateEventHandler(sender As Object,e As
System.Web.UI.WebControls.AuthenticateEventArgs)’.

发生错误

<asp:Login ID="Login1" runat="server" OnAuthenticate="ValidateUser">

有关错误的详细信息.

Microsoft (R) Visual Basic Compiler version 8.0.50727.5420 for
Microsoft (R) .NET Framework version 2.0.50727.5420 Copyright (c)
Microsoft Corporation. All rights reserved.

C:inetpubwwwrootLogin.aspx(43) : error BC30408: Method ‘Protected
Sub ValidateUser(sender As Object,e As System.EventArgs)’ does not
have the same signature as delegate ‘Delegate Sub
AuthenticateEventHandler(sender As Object,e As
System.Web.UI.WebControls.AuthenticateEventArgs)’.

06001

Sub ValidateUser(sender As Object,e As
System.Web.UI.WebControls.AuthenticateEventArgs)’.

06002

解决方法

在您的错误消息之前有一条线索:

Microsoft (R) Visual Basic Compiler version 8.0.50727.5420 for Microsoft (R) .NET Framework version 2.0.50727.5420 Copyright (c) Microsoft Corporation. All rights reserved.

这是VB编译器的一个古老的(2005!)版本,可能不会处理委托方差.虽然您可以更改方法的签名,但最好还是让本地计算机使用更新版本的VB编译器.我的猜测是这是IIS为你做编译,所以你基本上需要编辑IIS设置. (我不是ASP.NET专家所以我不能确切地告诉你在哪里做到这一点,但希望这足以让你前进.)

我很惊讶这是你遇到的唯一问题,说实话 – 使用那个版本的VB,你没有LINQ例如……

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读