Re: File Upload cause complete page post back... Basicly the ajax part of the uploader is not working?

  •  06-18-2012, 4:15 AM

    Re: File Upload cause complete page post back... Basicly the ajax part of the uploader is not working?

    Hi davior14,
     
    Please try the example below, does it work for you?
     
    When you click on the post back button, the page will do a post back, and the label text will be changed to "post back!". But when I upload a file, the text has not changed, it means that the page has not do the post back.
     
    If it only happens on your page, please create an simple example which can reproduce this issue and post here. I will check it and get back to you as soon as possible. 
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.   
    8.     protected void Page_Load(object sender, EventArgs e)  
    9.     {  
    10.   
    11.         if (!IsPostBack)  
    12.         {  
    13.             label1.Text = "first load!";  
    14.         }  
    15.         else  
    16.         {  
    17.             label1.Text = "post back!";  
    18.         }  
    19.     }  
    20. </script>  
    21.   
    22. <html xmlns="http://www.w3.org/1999/xhtml">  
    23. <head runat="server">  
    24.     <title>Untitled Page</title>  
    25. </head>  
    26. <body>  
    27.     <form id="form1" runat="server">  
    28.         <div>  
    29.             <asp:Button ID="btnPostBack" runat="server" Text="Post back" />  
    30.             <asp:Label ID="label1" runat="server"></asp:Label>  
    31.             <asp:ScriptManager ID="ScriptManager1" runat="server">  
    32.             </asp:ScriptManager>  
    33.             <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
    34.                 <ContentTemplate>  
    35.                     <CuteWebUI:UploadAttachments ID="uploader1" runat="server">  
    36.                     </CuteWebUI:UploadAttachments>  
    37.                 </ContentTemplate>  
    38.             </asp:UpdatePanel>  
    39.         </div>  
    40.     </form>  
    41. </body>  
    42. </html>  
    Regards,
     
    Ken 
View Complete Thread