ASP.NET MVC Interface Controls - Dropdown List - Client-Side events





Use the ClientSideEvents.OnSelectedIndexChanged property to attach a client-side event handler that is executed when the selection is changed.
C#

Html.Obout(new OboutDropDownList("ddl1") 
{ 
    ClientSideEvents = new OboutDropDownListClientSideEvents() 
    { 
      OnSelectedIndexChanged = "onChange" 
    } 
})
    
JavaScript
function onChange(sender, index) {
    alert('A new country was selected: ' + sender.options[index].text);
}