New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnClientValidationFailed

The OnClientValidationFailed client-side event occurs after a validation for selected file has failed either due to invalid file size or invalid extension.

The event handler receives two parameters:

  1. The instance of the RadCloudUpload control firing the event.

  2. An eventArgs parameter containing the following methods:

  • get_fileName returns the name of the file whose validation has failed.

  • get_message returns the original message from the localization.

You could raise an alert, showing the user the validation error message from the control's localization.

<telerik:RadCloudUpload runat="server" ID="RadCloudUpload1" OnClientValidationFailed="onClientValidationFailed" AllowedFileExtensions=".xslt" ...>
</telerik:RadCloudUpload>
function onClientValidationFailed(sender, eventArgs) {
    alert(eventArgs.get_message())
}
In this article