NET AJAX CLIENT LIBRARIES 76
The $addHandlers shortcut (Sys.UI.DomEvent.addHandlers) can be used to wire up
more than one event handler to a particular event; in which case, you can have multiple
event handlers that will be executed when the target event has been triggered.
To dynamically remove an event handler from an event on a control, use the
Sys.UI.DomEvent.removeHandler (or $removeHandler) with the identical signature as the
addHandler method (the target control, the event name, and the event handler). To
remove the repositionPanel method as the event handler of Button1, you would have the
following script:
$removeHandler(Button1, "click", repositionPanel);
Also, if you wanted to clear all the associated event handlers with an event on a
control, you could do so with the self-explanatory Sys.UI.DomEvent.clearHandler (or the
$clearHandler shortcut).
Global Shortcuts
All these shortcuts have been either mentioned or explained by this point in the chapter.
However, given their utility and importance, they??™re worth another look in one location.
You will come across these not only in your development needs but also in countless
places in ASP.
Pages:
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142