我为我正在处理的网站实施了自定义HttpModule。它旨在对 PreSendRequestContent 事件执行操作。当我运行调试器并内置Visual Studio Server时,它运行没有任何问题。当我将它发布到Live Server时它没有。我正在使用IIS的经典模式配置,这意味着我只需要将模块添加到 web.config 文件中。我错过了什么吗?
命名空间SmartBilling {
public class HttpModule : IHttpModule
{
public HttpModule()
{
}
public void Init(HttpApplication httpApplication)
{
// Register our event handler with Application object.
httpApplication.PreSendRequestContent += new EventHandler(httpApplication_PreSendRequestContent);
}
void httpApplication_PreSendRequestContent(object sender, EventArgs e)
{
// Do stuff
}
public void Dispose()
{
// Left blank because we dont have to do anything.
}
}
}