本人在写一个过滤器,过滤一些不要的会员帐号...思想是这样的:
写一个实现IHttpModule的类..,然后在web.config在添加相关的代码..通过检测Session来实现
这个方法在aspx的页面里,可以正确实现我的要求..但在ashx类型的页面里,就报Session没值..
public void Init(HttpApplication application)
        {            application.AcquireRequestState +=
                (new EventHandler(this.Application_BeginRequest));
        }        private void Application_BeginRequest(Object source,
             EventArgs e)
        {            HttpApplication application = (HttpApplication)source;
            HttpContext context = application.Context;
            HttpSessionState _Session = context.Session;            if (_Session == null)
                return;            string username = _Session["username"] as string; //ashx的文件,提示这里有问题
            
                context.Response.Write("<h1><font color=red>" + username +
                    "HelloWorldModule: Beginning of Request" +
                    "</font></h1><hr>");
            
        }请问哪个大侠碰到过这种问题,谁能提供解决方法?