当前位置 : 主页 > 网络编程 > ASP >

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

来源:互联网 收集:自由互联 发布时间:2021-06-24
不确定我做错了什么…… 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.
不确定我做错了什么……

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:\inetpub\wwwroot\Login.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.EventArgs)’ does not
have the same signature as delegate ‘Delegate Sub
AuthenticateEventHandler(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例如……

网友评论