New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Events

RadAsyncUpload supports the following client-side events:

RadAyncUpload

To use these events, simply write a JavaScript function that can be called when the event occurs. Then assign the name of the JavaScript function as the value of the corresponding property:

ASPNET
<telerik:radupload id="RadUpload1" runat="server" onclientfileuploadremoving="confirmDeletes"></telerik:radupload>

You can also assign event handlers in client-side code. When using the client-side API, pass a reference to the event handler rather than its name. One advantage of using the client-side API is that you can attach multiple event handlers to one event using the standard Microsoft AJAX convention:

JavaScript
<script type="text/javascript">

	function confirmDeletes(sender, eventArgs) {
		if (!confirm("Are you sure you want to delete the selected row?")) eventArgs.set_cancel(true); 
	}
	 
	function onAddedHandler1() {
		alert("First handler called");
	}

	function onAddedHandler2() {
		alert("Second handler called"); 
	}

	function pageLoad() {
		var upload = $find("<%= RadUpload1.ClientID %>");
		upload.add_added(onAddedHandler1);
		upload.add_added(onAddedHandler2); 
	}
 </script>

Another advantage of the client-side API is that you can detach an event handler dynamically:

JavaScript
<script type="text/javascript">
	function removeOnAdded2() {
		var upload = $find("<%= RadUpload1.ClientID %>");
		upload.remove_added(onAddedHandler2); 
	}
</script>

Note that on the client-side, the names of events are slightly different than on the server side. The following table shows the correspondence between client-side and server-side names:

 

Server-Side NameClient-SideNameMethods to add and Remove
OnClientAddedaddedadd_added, remove_added
OnClientFileSelectedfileSelectedadd_fileSelected, remove_fileSelected
OnClientFileUploadingfileUploadingadd_fileUploading, remove_fileUploading
OnClientFileUploadedfileUploadedadd_fileUploaded, remove_fileUploaded
OnClientFilesUploadedfilesUploadedadd_filesUploaded, remove_filesUploaded
OnClientProgressUpdatingprogressUpdatingadd_progressUpdating, remove_progressUpdating
OnClientValidationFailedvalidationFailedadd_validationFailed, remove_validationFailed
OnClientFileUploadFailedfileUploadFailedadd_fileUploadFailed, remove_fileUploadFailed
OnClientFileUploadRemovingfileUploadRemovingadd_fileUploadRemoving, remove_fileUploadRemoving
OnClientFileUploadRemovedfileUploadRemovedadd_fileUploadRemoved, remove_fileUploadRemoved

See Also

Getting Started

Client-Side Basics

OnClientAdded

In this article
RadAyncUploadSee Also
Not finding the help you need?
Contact Support