So, a bit complicated and I'm guessing there's an issue with my JavaScript so any help would be appreciated.
Here's my code:
Master Page
ASPX
ASCX
<
telerik:RadScriptBlock
runat
=
"server"
ID
=
"RadScriptBlock1"
>
<
script
type
=
"text/javascript"
>
//.Master file needs: function pageLoad() { loadAsync() }
//Utils.js - loadAsync(), dropHandler(), dragEnterHandler(), dragLeaveHandler()
function fileUploaded<%= AsyncUpload1.ClientID %>(sender, args) {
alert("fileUploaded<%= AsyncUpload1.ClientID %>");
$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).hide();
$find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAssets<%= AsyncUpload1.ClientID %>");
$telerik.$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).html("");
sender.deleteFileInputAt(0);
}
function validationFailed<%= AsyncUpload1.ClientID %>(sender, args) {
alert("validationFailed<%= AsyncUpload1.ClientID %>");
$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).show();
$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).html("Sorry, you are trying to upload an invalid type of file.");
if ($(".filetypes").text() != "") {
var types = $(".filetypes").text().replace("(", "").replace(")", "");
$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).append(" You can upload the following types of file: " + types + ".");
}
sender.deleteFileInputAt(0);
}
</
script
>
<
script
type
=
"text/javascript"
>
//Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; };
Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; };
</
script
>
</
telerik:RadScriptBlock
>
<
telerik:RadCodeBlock
runat
=
"server"
ID
=
"RadCodeBlock1"
>
<
span
class="msg error invalid msg<%= AsyncUpload1.ClientID %>" style="display:none;"></
span
>
</
telerik:RadCodeBlock
>
<
div
id
=
"pnlDropZone"
runat
=
"server"
class
=
"dropzone dr{0}"
>
<
h5
>To upload, drop files here</
h5
>
<
p
>or</
p
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"AsyncUpload1"
MultipleFileSelection
=
"Automatic"
MaxFileSize
=
"52428800"
Localization-Select
=
"Select Files"
DropZones
=
".dropzone"
/>
</
div
>
ASCX.VB
CSS
My problem is that when I drag a file to the DropZone for either of the controls, both '
fileUploaded' functions are called and the file is uploaded twice. If I drag to the actual AsyncControl itself, everything works fine and the file is only uploaded once.
Help!?
Tony.