怎么实现检查session权限的过滤器
我想做一个检查session["CurrentUser"]是否存在的过滤器
请问是在httpModule写还是httpHandler里写?
能说明一下给个示例吗
------解决方案--------------------
放 httpModule
public void Init(HttpApplication app)
{
//建立安全模块
app.BeginRequest += (new EventHandler(this.BeginRequest));
}
private void BeginRequest(object o, EventArgs e)
{
HttpApplication app = o as HttpApplication;
HttpContext content = app.Context;
if (content.session["CurrentUser"] == null)
{
}
}