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

asyncupload control causing all other controls to reload

4 Answers 87 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 26 Mar 2014, 06:13 PM
Hello,

I am trying to use the asyncupload control within a DNN (Dotnetnuke) module.

The control basically works but the control causes all the other controls on the page to refresh when the postback fires.

I've wrapped the asyncupload control in an ajaxpanel. It uploads the file fine and calls the 'onfileupload'  event with a parameter successfully. I use this event to copy the uploaded to a destination based on the parameter.

I can supply code snippets to give more detail, but am unable to paste into this thread.

But how can I stop it from loading all the other controls on the page?

I'd be very grateful for any helpful suggestions.

Best Regards,

Steve

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Mar 2014, 04:07 AM
Hi Stephen,

Please try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" PostbackTriggers="RadButton2"
        OnFileUploaded="RadAsyncUpload1_FileUploaded">
    </telerik:RadAsyncUpload>
    <telerik:RadButton ID="RadButton2" runat="server" Text="Upload">
    </telerik:RadButton>
</telerik:RadAjaxPanel>

C#:
protected void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
{
    //your code
}

Thanks,
Shinu.
0
Stephen
Top achievements
Rank 1
answered on 27 Mar 2014, 01:29 PM
Hello Shinu,

Thank you for your reply. I made the changes as you suggested but it still causes each control on the page to reload. I did adapt the code to run in a DNN environment, but that just means using the dnn wrappers for each telerik control. I would post the code here, but can't paste.

​I included an 'OnClientFileUpload' event to call my JQuery. The server side is called correctly and the file uploaded.

As a work around I can check IsPostback in the Page_Load for each user control. That does at least preserve the settings but obviously that's not really the answer.

Steve
0
Stephen
Top achievements
Rank 1
answered on 28 Mar 2014, 02:38 PM
Hello,

I still have the same page refresh problem. It's now a problem as the main page and all its' controls are refreshed which reruns all the javascript for each control.

Does anyone have any ideas as to what would cause the asyncupload control to refresh the whole page.

Steve
0
Stephen
Top achievements
Rank 1
answered on 28 Mar 2014, 04:20 PM
Here's my code snippet:
<cc1:DnnAjaxPanel ID="ImageDnnAjaxPanel" runat="server">
 
    <cc1:DnnAsyncUpload runat="server" PostbackTriggers="UploadButton"
                        id="myuploadcontrol"
                        OnClientFileUploaded="OnClientFileUploaded"
                        OnFileUploaded="myuploadcontrol_FileUploaded">
    </cc1:DnnAsyncUpload>
 
    <cc1:DnnButton ID="UploadButton" runat="server" Text="Upload"></cc1:DnnButton>
 
</cc1:DnnAjaxPanel>
 
 
 
protected void myuploadcontrol_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
{
    //mycode
}

Tags
AsyncUpload
Asked by
Stephen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
Share this question
or