I have created AJAX extender control. When initializing the javascript Behavior class I'm registering load handler to call a WCF service upon control load (in the this._onLoad handler). I have registered the event handler for the web service callBack as follows:
EditableFieldInfoBehavior.prototype =
{
initialize: function() {
EditableFieldInfoBehavior.callBaseMethod
(this, 'initialize');
//create onload handler which will call the web service
Sys.Application.add_load(Function.createDelegate(this, this._onLoad));
// I call the web service method in this._onLoad event handler
//init my web service proxy
this._serviceProxy = new IEditableFieldInfoService();
this Go to the complete details ...