我的类库中有一个名为API的httpmodule类,这个类库中的httpmodule名为FileUploadModule.vb。
我已经向<add name="FileUploadModule" type="FileUploadModule, API" />注册了system.web部分中的httpmodule。
这是注册httpmodule的正确方式吗?
当我调试vb.net 2.0框架web应用程序时,为什么我的debug模块不能触发?
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发布于 2011-03-01 17:07:23
我发现了一篇关于堆栈溢出的文章,这篇文章也对我有帮助,@adt也给我指出了正确的方向,并让它发挥了作用。
基本上,我添加了注册的httpmodule:
<system.webServer>
<modules>
<add name="FileUploadModuleControl" type="API.FileUploadModuleControl"/>
</modules>
它成功了!
我在"500 Internal Server Error" when adding HttpModule in my Website?上找到了一篇关于stackoverflow的文章。
发布于 2011-03-01 08:04:30
注册似乎有问题。
<httpModules>
<add type="classname, assemblyname" name="modulename" />
<httpModules>您的程序集名称是API吗?
https://stackoverflow.com/questions/5149004
复制相似问题