Events
The Telerik UI ListBox for ASP.NET MVC exposes a number of events that allow you to control the behavior of the UI component.
For a complete example on basic ListBox events, refer to the demo on using the events of the ListBox.
Handling by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().ListBox()
.Name("listbox")
.Events(e => e.Change("onChange"))
... //Additional configuration
)
<script>
function onChange(e){
// Handle the ListBox Change event that triggers when a specified item has been selected.
};
</script>
Handling by Template Delegate
The following example demonstrates how to subscribe to events by a template delegate.
@(Html.Kendo().ListBox()
.Name("listbox")
.Events(e => e.Change(@<text>
function() {
// Handle the ListBox Change event inline.
}
</text>)
)
... //Additional configuration
)