OnUploadCompleted Not firing in code behind.

Last post 09-01-2010, 8:19 AM by Tarus. 6 replies.
Sort Posts: Previous Next
  •  08-31-2010, 8:53 AM 63754

    OnUploadCompleted Not firing in code behind.

     
    Hello,
     
    I'm evaluating the Uploader before we purchase.  I've implemented the Uploader in a Dot Net Nuke environment.
     
    I can see the files uploading into the temp folder and the progress screen works fine. After it is done though it never run the UploadCompleted code. The screen refreshes and starts from the beginning.
     
     <CuteWebUI:UploadAttachments ID="Uploader1" runat="server" InsertText="Browse Files" OnUploadCompleted="Uploader1_UploadCompleted">
                             <InsertButtonStyle />
     </CuteWebUI:UploadAttachments>
     
    Thanks
     
    Tarus
     
    I can send you the code if you need it.
  •  08-31-2010, 9:23 AM 63758 in reply to 63754

    Re: OnUploadCompleted Not firing in code behind.

    Dear Tarus,
     
    Please try the following tested code, it works:
     
    AspxAndCSSeparate.aspx:
     
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AspxAndCSSeparate.aspx.cs" Inherits="AspxAndCSSeparate" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
       
        </div>
        <CuteWebUI:UploadAttachments ID="UploadAttachments1" runat="server"
            onfileuploaded="Uploader_FileUploaded">
        </CuteWebUI:UploadAttachments>
        </form>
    </body>
    </html>
     
    AspxAndCSSeparate.aspx.cs:
     
    public partial class AspxAndCSSeparate : System.Web.UI.Page
    {
          protected void Uploader_FileUploaded(object sender, CuteWebUI.UploaderEventArgs args)
        {      
            //Copys the uploaded file to a new location.
            args.CopyTo("c:\\temp\\"+args.FileName);    
        }
    }
     
    Thanks for asking
     
  •  08-31-2010, 9:55 AM 63760 in reply to 63758

    Re: OnUploadCompleted Not firing in code behind.


     
    Tested code is great to have, but I need to have it work within my page layouts and code.
     
    Can I attach/send you my code and have you review?
     
    Thank You
     
    Tarus
  •  08-31-2010, 10:02 AM 63761 in reply to 63760

    Re: OnUploadCompleted Not firing in code behind.

    Dear Tarus,
     
    Please extract your code to one simple project which can reproduce your issue, and then send it to eric@cutesoft.net, we will check it.
     
    Thanks for asking
  •  08-31-2010, 3:21 PM 63764 in reply to 63761

    Re: OnUploadCompleted Not firing in code behind.


     
     I'm finding that the issue is related to me using an Update Panel -
    since the asp:FileUpload doesn't work properly either.
     
    I'm seeing if I can work around this issue. Would like to know if you have a solution.
  •  09-01-2010, 1:04 AM 63776 in reply to 63764

    Re: OnUploadCompleted Not firing in code behind.

    Hi Tarus,
     
    Please test the example below. AjaxUploader work with a UpdatePanel and the method UploadCompleted works fine.
     
    If you  still get this issue, please create a simple page which can reproduce this issue and send it to Kenneth@CuteSoft.net. I will check it and get back to you as soon as possible.
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    4.   
    5. <script runat="server">   
    6.   
    7.     protected void uploader1_UploadCompleted(object sender, UploaderEventArgs[] args)   
    8.     {   
    9.         label1.Text = "upload complete fire";   
    10.     }   
    11. </script>   
    12.   
    13. <html xmlns="http://www.w3.org/1999/xhtml">   
    14. <head runat="server">   
    15.     <title>Untitled Page</title>   
    16. </head>   
    17. <body>   
    18.     <form id="form1" runat="server">   
    19.         <div>   
    20.             <asp:ScriptManager ID="ScriptManager1" runat="server">   
    21.             </asp:ScriptManager>   
    22.             <asp:UpdatePanel ID="updatePanel1" runat="server">   
    23.                 <ContentTemplate>   
    24.                     <CuteWebUI:Uploader ID="uploader1" runat="server" OnUploadCompleted="uploader1_UploadCompleted">   
    25.                     </CuteWebUI:Uploader>   
    26.                     <br />   
    27.                   <asp:Label ID="label1" runat="server"></asp:Label>    
    28.                 </ContentTemplate>   
    29.             </asp:UpdatePanel>   
    30.                 
    31.         </div>   
    32.     </form>   
    33. </body>   
    34. </html>  
    Regards,
     
    Ken
  •  09-01-2010, 8:19 AM 63789 in reply to 63776

    Re: OnUploadCompleted Not firing in code behind.

    I stripped down my code the best I could to resemble your sample - but still run within our DotNetNuke Framework.
     
    I'm still having issues - I've emailed to you.
     
    Thank You
View as RSS news feed in XML