Re: Remove button does not work properly

  •  06-05-2012, 7:36 AM

    Re: Remove button does not work properly

    Hi hamed415,
     
    Both methods works fine for me.  Below is my test example page. Does it work for you?
     
    Can you show me how you used these methods  ? So I can check it for you. 
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" 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.     protected void btnDelete_Click(object sender, EventArgs e)  
    8.     {  
    9.         for (int i = uploader1.Items.Count - 1; i >= 0; i--)  
    10.         {  
    11.             uploader1.DeleteAttachment(i);  
    12.         }  
    13.     }  
    14. </script>  
    15.   
    16. <html xmlns="http://www.w3.org/1999/xhtml">  
    17. <head id="Head1" runat="server">  
    18.     <title>example</title>  
    19. </head>  
    20. <body>  
    21.     <form id="form1" runat="server">  
    22.         <CuteWebUI:UploadAttachments ID="uploader1" runat="server" TempDirectory="tempFiles">  
    23.         </CuteWebUI:UploadAttachments>  
    24.         <br />  
    25.         <asp:Button ID="btnDelete" runat="server" Text="remove" OnClick="btnDelete_Click" />  
    26.     </form>  
    27. </body>  
    28. </html>  
    Regards,
     
    Ken 
View Complete Thread