This is a migrated thread and some comments may be shown as answers.

Upload progress appears with any postback

8 Answers 125 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ibrahim Imam
Top achievements
Rank 1
Ibrahim Imam asked on 14 Mar 2010, 06:01 PM
Hello,

I have a problem with the progress area of upload control . when i select file and click on any control that causes postback the upload process starts and progress area appears, but actually no file is uploaded   which is not convenient. I need only to show the progress area and begin upload process when i need so. please help me.
Thanks

8 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 16 Mar 2010, 05:00 PM
Hello Ibrahim Imam,

This is a known issue that we are about to fix. As a workaround please paste the following code right after your ScriptManager declaration:

<asp:ScriptManager runat="server" ID="ScriptManager1">
</asp:ScriptManager>
 
<script type="text/javascript">
      var prm = Sys.WebForms.PageRequestManager.getInstance();
      var originalClientSubmit;
  
      if (!originalClientSubmit) {
          originalClientSubmit =
              Telerik.Web.UI.RadProgressManager.prototype._clientSubmitHandler;
      }
  
      Telerik.Web.UI.RadProgressManager.prototype._clientSubmitHandler = function(e) {
          var isUploading = false;
  
          var inputs = $telerik.$("input[type='file']");
          $telerik.$.each(inputs, function() {
              if (this.value != "") {
                  isUploading = true;
                  return;
              }
          });
  
          if (isUploading)
              originalClientSubmit.apply(this, [e]);
      }
  </script>

Official fix will come with the next week's internal build. You can find more information on how to obtain the latest internal build here.

Sincerely yours,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Pierre MAUREL
Top achievements
Rank 1
answered on 18 Mar 2010, 10:17 AM
Hi, I have the same problem and I tried your solution, but my problem is that the Radupload is in a RadTabStrip and with your solution the RadTab doesn't work. I use RadControl 2008 Q3 and I can't upgrade because there would be too much work.
0
Pierre MAUREL
Top achievements
Rank 1
answered on 22 Mar 2010, 10:43 AM
No solution ????
0
Genady Sergeev
Telerik team
answered on 22 Mar 2010, 05:41 PM
Hello Pierre MAUREL,

You can find a solution that works with Q3 2008 as an attachment.

Best wishes,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Pierre MAUREL
Top achievements
Rank 1
answered on 23 Mar 2010, 05:53 PM
Thank you.
0
Pierre MAUREL
Top achievements
Rank 1
answered on 24 Mar 2010, 03:29 PM
Your solution doesn't work. The upload process still starts.
Can you try your exemple with a big file (the first time I tried with a small file and I didn't see the progress bar).

Edit : I solve my problem with this example : http://www.telerik.com/help/aspnet-ajax/upload_howtopreventupload.html

<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager runat="server" ID="ScriptManager1"
    </asp:ScriptManager> 
 
<script type="text/javascript"
function onClientSubmitting(progressManager, args) 
    var eventTarget = document.getElementById('__EVENTTARGET'); 
    if (eventTarget.value == '<%= RadTabStrip1.UniqueID %>') 
    { 
        //Clear the file inputs 
        var upload = $find("<%= RadUpload1.ClientID %>"); 
        var fileInputs = upload.getFileInputs(); 
        for (var i=0; i<fileInputs.length; i++) 
        { 
            upload.clearFileInputAt(i); 
        } 
    } 
</script> 
 
    <div> 
        <telerik:RadProgressManager runat="server" ID="RadProgressManager1" OnClientSubmitting="onClientSubmitting" /> 
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" EnableAJAX="false"
            <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="MultiPage1" AutoPostBack="false"
                <Tabs> 
                    <telerik:RadTab Text="Tab1"
                    </telerik:RadTab> 
                    <telerik:RadTab Text="Tab2"
                    </telerik:RadTab> 
                </Tabs> 
            </telerik:RadTabStrip> 
            <telerik:RadMultiPage runat="server" ID="MultiPage1"
                <telerik:RadPageView runat="server" ID="Page1"
                    <telerik:RadUpload runat="server" ID="RadUpload1"
                    </telerik:RadUpload> 
                    <telerik:RadProgressArea runat="server" ID="RadProgressArea1"
                    </telerik:RadProgressArea> 
                    <asp:Button runat="server" ID="Button1" Text="Postback" /> 
                </telerik:RadPageView> 
                <telerik:RadPageView runat="server" ID="Page2"
                    Second tab 
                </telerik:RadPageView> 
            </telerik:RadMultiPage> 
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 
</body> 
</html> 

0
Amar
Top achievements
Rank 1
answered on 07 Jan 2015, 05:11 PM
I am using q3 2014 version of Telerik Asp.net UI and I have the same issue. I have 2 RadDropDownTree one of which does a postback and instead of using the Radupload i am using the asp.net File upload control. when the postback from the RadDropDownTree occurs and if there is a file selected in the fileupload control , the RadProgressbar appears which is not what i want. Since there is a submit button on the form, i want the progress bar to only appear on the submit button click. Please help
0
Nencho
Telerik team
answered on 12 Jan 2015, 01:29 PM
Hello Amar,

Assuming that you use the ProgressArea, I must inform you that this behavior is expected, since the asp:fileupload is waiting for a postback on the page to submit the selected file. This is why, when a postback from RadDropDownTree the file is submitted and the ProgressArea appears.

I can suggest you two things for overcoming the experienced behavior
  1. Use the RadAsyncUpload instead of the asp:FIleUpload, because the Async has a PostbackTriggers property, which you can use to specify for which control's postback the AsyncUpload should listen to and submit the file.

  2. You can ajaxify the RadDropDownTree, by nesting it in an UpdatePanel. In this case, there is no full postback and the selected file will not get submitted.

Regards,
Nencho
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.

 
Tags
Upload (Obsolete)
Asked by
Ibrahim Imam
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Pierre MAUREL
Top achievements
Rank 1
Amar
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or