Hi Telerik,
is "set_cancel" method still supporting OnClientFileUploading(http://www.telerik.com/help/aspnet-ajax/asyncupload-onclientfileuploading.html)?
I tried to use args.set_cancel(true) but got a javascript exception - Microsoft JScript runtime error: Object doesn't support property or method 'set_cancel'
Below is my code:
Javascript:
function OnClientFileUploading(sender, eventArgs) {
HTML:
is "set_cancel" method still supporting OnClientFileUploading(http://www.telerik.com/help/aspnet-ajax/asyncupload-onclientfileuploading.html)?
I tried to use args.set_cancel(true) but got a javascript exception - Microsoft JScript runtime error: Object doesn't support property or method 'set_cancel'
Below is my code:
Javascript:
function OnClientFileUploading(sender, eventArgs) {
//cancel the upload
eventArgs.set_cancel(
true);
alert(
'no duplicate file: ' + args.get_fileName());
//hide the uploading item
$telerik.$(eventArgs.get_row()).css(
"display", "none");
}HTML:
<
telerik:radasyncupload id="Radasyncupload1" runat="server"
OnClientFileUploading="OnClientFileUploading"
>
</telerik:radasyncupload>
5 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 07 May 2012, 11:00 AM
Hi Joan,
I tried the same scenario in the latest version(2012, 1, 411, 35) in which args.set_cancel method is supporting. Please upgrade to latest version.
Thanks,
Princy.
I tried the same scenario in the latest version(2012, 1, 411, 35) in which args.set_cancel method is supporting. Please upgrade to latest version.
Thanks,
Princy.
0
Yi Ling
Top achievements
Rank 1
answered on 07 May 2012, 01:25 PM
Is it supported in 2011.1.509.35?
0
Hello Joan,
The set_cancel() function was introduced in version 2011.2.915 of the controls.
All the best,
Bozhidar
the Telerik team
The set_cancel() function was introduced in version 2011.2.915 of the controls.
All the best,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Peter
Top achievements
Rank 1
answered on 03 Mar 2015, 07:05 AM
I'm getting this error in the latest 2014 build:
function OnClientFileUploading(sender, args) {
//alert(args.get_fileName().length);
args.set_cancel(!window.confirm('Are you sure?'));
}
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'set_cancel'
function OnClientFileUploading(sender, args) {
//alert(args.get_fileName().length);
args.set_cancel(!window.confirm('Are you sure?'));
}
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'set_cancel'
0
Hello,
I tested the AsyncUpload and is seems to be working fine on my end. Here's the code I used:
Can you confirm that you are receiving the error with the same markup? If so, could you also specify the exact version of your controls, as well as the steps to reproduce (For instance what kind of file you are uploading. Also, is the issue reproduced in all browsers, or a specific one?
Regards,
Bozhidar
Telerik
I tested the AsyncUpload and is seems to be working fine on my end. Here's the code I used:
<
script
type
=
"text/javascript"
>
function onClientFileUploading(sender, args) {
args.set_cancel(true);
}
</
script
>
<
div
>
<
telerik:RadAsyncUpload
runat
=
"server"
OnClientFileUploading
=
"onClientFileUploading"
>
</
telerik:RadAsyncUpload
>
</
div
>
Can you confirm that you are receiving the error with the same markup? If so, could you also specify the exact version of your controls, as well as the steps to reproduce (For instance what kind of file you are uploading. Also, is the issue reproduced in all browsers, or a specific one?
Regards,
Bozhidar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.