0

错误:Option Strict On 不允许缩小方法'context_beginRequest<ByVal sender As Object, ByVal e As WindowsAuthenticationEventArgs>'和委托之间的隐式类型转换'<BeginRequest>'

对于代码:

Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
    'context.
    AddHandler context.BeginRequest, New EventHandler(AddressOf context_BeginRequest)
End Sub

context_BeginRequest 函数::

Public Sub context_BeginRequest(ByVal sender As Object, ByVal e As WindowsAuthenticationEventArgs)
.....

.....结束子

4

1 回答 1

0

那是因为HttpApplication.BeginRequestis just of type EventHandler... 所以你的第二个参数应该是 type EventArgs,而不是WindowsAuthenticationEventArgs

于 2015-07-22T19:50:35.313 回答