Catch SelectedIndexChanged Accordion Control Event in ASP.NET AjaxToolkit

I have an Accordion control that populates dynamically. I want to catch the event raised when opening a new panel to open. I do not see events in intelli-sense at all, and when I manually encode it, I get errors.

Is there any way to catch this event?

The goal is to let the manager on the main page that holds the Accordion know when the Accordion has changed so that it can update another control.

+3
source share
1 answer

To handle the event selectedIndexChangedon the client side:

function pageLoad()
{
    $find("accordionBehaviorID").add_selectedIndexChanged(
        accordion_selectedIndexChanged);
}

function accordion_selectedIndexChanged(sender, args)
{
    var oldIndex = args.get_oldIndex();
    var newIndex = args.get_selectedIndex();

    // Do something...
}

, :

function pageLoad()
{
    $find("accordionBehaviorID").add_selectedIndexChanged(
        function(sender, args) {
            // Do something...
        }
    );
}
+5

Source: https://habr.com/ru/post/1770585/


All Articles