HttpModule不会触发 [英] HttpModule wont fire

查看:56
本文介绍了HttpModule不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的类库中有一个名为API的httpmodule类,该类库中的httpmodule名为FileUploadModule.vb.

I have an httpmodule class in my class library called API and the httpmodule in this class library is called FileUploadModule.vb.

我已经在system.web部分中用<add name="FileUploadModule" type="FileUploadModule, API" />注册了httpmodule.

I have registered the httpmodule in the system.web section with <add name="FileUploadModule" type="FileUploadModule, API" />.

这是注册httpmodule的正确方法吗?

Is this the correct way to register an httpmodule?

为什么我在调试vb.net 2.0框架Web应用程序时无法启动httpmodule?

Why won't my httpmodule fire when i debug the vb.net 2.0 framework web application?

Public Class FileUploadModule
Implements IHttpModule

Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
End Sub

Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
    AddHandler context.BeginRequest, AddressOf OnBeginRequest
End Sub

Public Sub OnBeginRequest(ByVal sender As Object, ByVal e As EventArgs)
    Dim app As HttpApplication = CType(sender, HttpApplication)
    app.Context.Response.Write("ddddddddddddddddddd")
End Sub

End Class

推荐答案

我发现了一篇有关堆栈溢出的文章,该文章对我也有帮助,@ adt也向我指出了正确的方向并使其起作用,

I found an article on stack overflow that helped me also and @adt pointed me in the right direction aswell and got it to work,

我基本上在以下位置添加了注册的httpmodule:-

Basically i added registered the httpmodule in:-

<system.webServer>
  <modules>
     <add name="FileUploadModuleControl" type="API.FileUploadModuleControl"/>
  </modules>

它奏效了!.

我发现有关stackoverflow有用的文章位于 "500内部服务器错误";在我的网站中添加HttpModule时是什么?.

The article i found usefule on stackoverflow was at "500 Internal Server Error" when adding HttpModule in my Website?.

这篇关于HttpModule不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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