As mentioned in Telerik Documentation, it's upload control re-acts on postback. Here some users are concerned, that RAD Upload control fires its submit event, when they click to other button or any control which postback on the web form.
Related to this, Telerik online documentation also has got a solution (How to Prevent Upload). After revising those codes, I have modified it little and written codes in a way that users can easily achieve the target.
Javascript:
Note: ButtonUpload is a LinkButton; Upload must be start when the ButtonUpload is fired.
In the .aspx
Note: Make sure to provide the onClientSubmitting method to RadProgressManager
Excluding to this topic: Some users very often complain that RadProgressArea does not work while uploading. And regarding to my experience it happens when your Application's Trust level is medium.
You can adjust it by writing these codes in web.config:
Thank You
Regards,
Tekie
Related to this, Telerik online documentation also has got a solution (How to Prevent Upload). After revising those codes, I have modified it little and written codes in a way that users can easily achieve the target.
Javascript:
<script type="text/javascript"> |
function onClientSubmitting(progressManager, args) { |
var eventTarget = document.getElementById('__EVENTTARGET'); |
if (eventTarget.value == '<%= ButtonUpload.UniqueID %>') { } else { |
var upload = $find("<%= RadUpload1.ClientID %>"); |
var fileInputs = upload.getFileInputs(); |
for (var i = 0; i < fileInputs.length; i++) { |
upload.clearFileInputAt(i); |
} |
} |
} |
</script> |
In the .aspx
<telerik:RadProgressManager id="Radprogressmanager1" runat="server" OnClientSubmitting = "onClientSubmitting" /> |
<telerik:RadUpload ID="RadUpload1" runat="server" TargetFolder="uploads" |
ControlObjectsVisibility="None" Height="25px" MaxFileInputsCount="1" Width="214px" |
> |
</telerik:RadUpload> |
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" Language="" |
DisplayCancelButton="True"> |
<Localization Uploaded="Uploaded"></Localization> |
</telerik:RadProgressArea> |
<br /> |
<asp:LinkButton runat="server" id="ButtonUpload" text="Upload" /> |
Excluding to this topic: Some users very often complain that RadProgressArea does not work while uploading. And regarding to my experience it happens when your Application's Trust level is medium.
You can adjust it by writing these codes in web.config:
<system.web> |
<trust level="Full" /> |
</system.web> |
Thank You
Regards,
Tekie