Version

SelectionChanged Property (DropDownClientEvents)

Syntax
'Declaration
 
Public Property SelectionChanged As String
public string SelectionChanged {get; set;}
Example
WebDropDown1.ClientEvents.SelectionChanged = "WebDropDown_SelectionChanged"
WebDropDown1.ClientEvents.SelectionChanged = "WebDropDown_SelectionChanged";
// The client event 'SelectionChanged' takes two parameters sender and e
// sender  is the object which is raising the event
// e is the DropDownSelectionEventArgs
function WebDropDown_SelectionChanged(sender, e) {

    //Gets the new collection of selected drop-down items
    //Only one item will be in the collection when multiple selection is disabled          
    var newSelection = e.getNewSelection();

    //Gets the text of the first drop-down item in the collection
    var text = newSelection[0].get_text();

    //Gets the index of the first drop-down item in the collection
    var index = newSelection[0].get_index();
           
    alert("Item '" + text + "' with index "+index+" is selected!");
    

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also