有谁知道使用 HttpModule 将事件添加到 Session 的 OnStart 和 OnEnd 事件的干净方法(不涉及 Global.asax 文件)?
最佳答案
public void Init(HttpApplication app)
{
var ssm = app.Modules["Session"] as SessionStateModule;
ssm.Start += Foo;
ssm.End += Bar;
}
关于asp.net - 使用 HttpModules 将事件附加到 Session OnStart 和 OnEnd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/539171/