我收到以下错误
'事件处理程序只能在IHttpModule初始化期间绑定到HttpApplication事件.在以下代码中(粗体或双线**)
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
**app.EndRequest += new EventHandler(Application_EndRequest);**
}
protected void Application_EndRequest(object sender, EventArgs e)
{
UnitOfWork.Commit();
}
Run Code Online (Sandbox Code Playgroud)
在Global.asax文件中提到.有人可以弄清楚,我缺少的地方吗?谢谢.