views:

78

answers:

1

I checked my html page generated by asp.net and I can see this line

Sys.Application.initialize();
Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.CollapsiblePanelBehavior,
    {
        "ClientStateFieldID":"rptActiveQuotes_ctl01_qcQuote_cpeDetails_ClientState",
        "CollapseControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide",
        "Collapsed":true,
        "CollapsedImage":"Images/expandablePlus.gif",
        "ExpandControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide",
        "ExpandedImage":"Images/expandableMinus.gif",
        "ImageControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide",
        "id":"rptActiveQuotes_ctl01_qcQuote_cpeDetails"
    }, 
    null, 
    null, 
    $get("rptActiveQuotes_ctl01_qcQuote_pDetails"));
}); 

I think it's generated from CollapsiblePanelExtender with name cpeDetails. And I see you can pass number of events to it, wich is now null (third argument). What should I do to set add_ended event there?

A: 

Hey,

AJAX controls/extenders have a bunch of OnClient properties,which you assign the name of a method as the handler as in OnClientClicked="funcname". You can define that on the server, and it gets wired up on the client. You can also register an event handler on the client to, as in:

var o = $find("<%= cpeDetails.ClientID %>");
o.add_<event>(function(sender, e) 
   //event handler code
});

So you could do o.add_ended(function() { /* handler */ }). Is there an ended event? I don't recall that being an option...

HTH.

Brian