Events
The Telerik UI Upload for ASP.NET MVC exposes multiple events that allow you to control and customize the behavior of the UI component.
For a complete example on basic Upload events, refer to the demo on using the events of the Upload.
The following events fire only when the Upload is in an asynchronous mode of operation:
Cancel
,Complete
,Error
,Progress
,Success
, andUpload
.
Handling by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().Upload()
.Name("upload")
.Multiple(true)
.Async(a => a
.Save("SaveAsync", "Upload")
.Remove("Remove", "Upload")
)
.Events(events => events
.Upload("onUpload")
.Success("onSuccess")
)
)
<script>
function onUpload(e) {
// Handle the upload event.
}
function onSuccess(e) {
// Handle the success event.
}
</script>
Handling by Template Delegate
The following example demonstrates how to subscribe to events by using a template delegate.
@(Html.Kendo().Upload()
.Name("upload")
.Multiple(true)
.Async(a => a
.Save("SaveAsync", "Upload")
.Remove("Remove", "Upload")
)
.Events(events => events
.Upload(@<text>
function() {
// Handle the Upload event inline.
}
</text>)
.Success(@<text>
function() {
// Handle the Success event inline.
}
</text>)
)
)