更新:2007 年 11 月
初始化 EventHandlerList 类的新实例。
var e = new Sys.EventHandlerList();
备注
EventHandlerList 构造函数创建 EventHandlerList 类的一个新实例,该实例是一个保存事件及其处理程序的字典。
每个 ASP.NET AJAX 组件和应用程序已经在其 events 属性中包含一个 EventHandlerList 实例,所以通常不需要直接使用此构造函数。
若要访问与当前组件或应用程序关联的 EventHandlerList 实例,请调用 this.get_events(),如下面的示例所示:
_clickHandler: function(event) {
var h = this.get_events().getHandler('click');
if (h) h(this, Sys.EventArgs.Empty);
},
此示例是 EventHandlerList 类概述中包含的一个较大示例的一部分。