asyncupload control causing all other controls to reload

5 posts, 0 answers
  1. Stephen
    Stephen avatar
    6 posts
    Member since:
    Jul 2012

    Posted 26 Mar 2014 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Mar 2014 in reply to Stephen Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stephen
    Stephen avatar
    6 posts
    Member since:
    Jul 2012

    Posted 27 Mar 2014 in reply to Shinu Link to this post

    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
  5. Stephen
    Stephen avatar
    6 posts
    Member since:
    Jul 2012

    Posted 28 Mar 2014 in reply to Stephen Link to this post

    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
  6. Stephen
    Stephen avatar
    6 posts
    Member since:
    Jul 2012

    Posted 28 Mar 2014 Link to this post

    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
    }

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017