How can I add validation to my asyncupload control for the current version of Telerick Q3 2012 SP1? I've tried the following but it is not working with the current version. I very well could be doing something wrong. Any thoughts on how to make this work? Here is the code that I'm using, followed by the error I'm getting. I'm in VS 2012 and using DotNet 4.5.
<
script
type
=
"text/javascript"
>
Telerik.Web.UI.RadAsyncUpload.prototype.getUploadedFiles = function() {
var files = [];
$telerik.$(".ruUploadSuccess", this.get_element()).each(function(index, value) {
files[index] = $telerik.$(value).text();
});
return files;
}
function validateUpload(sender, args) {
var upload = $("RadAsyncUpload1");
args.IsValid = upload.getUploadedFiles().length != 0;
}
</
script
>
<
asp:CustomValidator
runat
=
"server"
ID
=
"CustomValidator"
ClientValidationFunction
=
"validateUpload"
ErrorMessage
=
"Select at least a single file"
>
</
asp:CustomValidator
>
Here is the error:
Microsoft JScript runtime error: Object doesn't support this property or method.
Thanks,
shawn