摘要: 最近有时间看一些.net的框架代码,发现一个有意思的问题,就是HttpModule中的 Init函数下的事件绑定,因为事件的绑定在事件发生后相应的处理委托即为null,但 下面的代码(功能:地址的重定向)为什么只是绑定一次后就能在每个WEB请求过来 时都能运行ReUrl_BeginRequest事件呢。 public class HttpModule : System.Web.IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(ReUrl_BeginRequest); .... } private void ReUrl_BeginRequest(object sender, EventArgs e) { .... } 阅读全文
posted @ 2007-03-09 16:30 代震军 阅读(4031) 评论(13) 推荐(0) 编辑