C# 应用程序_BeginRequest事件未触发
我正在处理应用程序_BeginRequest事件,该事件应该在请求某个url时触发C# 应用程序_BeginRequest事件未触发,c#,asp.net,global-asax,C#,Asp.net,Global Asax,我正在处理应用程序_BeginRequest事件,该事件应该在请求某个url时触发 protected void Application_BeginRequest(Object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString() == DummyPageUrl) { RegisterCacheEntry();
protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.Request.Url.ToString() == DummyPageUrl)
{
RegisterCacheEntry();
}
}
下面是我用来请求url的代码:
private void HitPage()
{
WebClient client = new WebClient();
client.DownloadData(DummyPageUrl);
}
但应用程序_BeginRequest事件未触发。
我也在web.config中尝试过这一点:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
这没用。请帮帮我。你在global.asax工作吗 在Global.asax页面中尝试此操作
void Application_BeginRequest(object sender, EventArgs e)
{
}
您对IIS应用程序池使用的是经典管道还是集成管道?