Re: Compilation error when trying to overload click event

  •  10-04-2012, 3:34 AM

    Re: Compilation error when trying to overload click event

    Wow, you guys respond fast. I love it!

     

    Changing the arguments in the method from UploaderEventArgs to AttachmentItemEventArgs fixed the error. So now my web page runs fine when I press the remove button on the attachment items, but my submit button still stays active even though there are no items in the list. 

     

    Does the uploader somehow override the changes I make when the button is rendered?

     

    To clarify further, here is all the code involved in this:

     

    1. <asp:Button ID="btnMultipleAttachment" runat="server" Text="Browse" CssClass="button" />                     
    2. <CuteWebUI:UploadAttachments runat="server" ID="ajaxBinaryAttach"       InsertButtonID="btnMultipleAttachment" OnUploadCompleted="enableSubmitBtn" OnAttachmentRemoveClicked="disableSubmitBtn"
    3. <ValidateOption MaxSizeKB="153600" AllowedFileExtensions="iso,zip,png,bmp,xml" />     
    4. </CuteWebUI:UploadAttachments>  
    5. <asp:Button ID="btnSubmitMultiple" runat="server" Text="Submit attachments" visible="true" Enabled="false" OnClick="btnSubmitMultiple_Click" />  
    6.   
    7. void enableSubmitBtn(object sender, UploaderEventArgs[] args)  
    8.         {  
    9.   
    10.             btnSubmitMultiple.Enabled = true;  
    11.   
    12.         }  
    13.   
    14. void disableSubmitBtn(object sender, AttachmentItemEventArgs args)  
    15.         {  
    16.             if (ajaxBinaryAttach.Items.Count == 0)  
    17.             {  
    18.                 btnSubmitMultiple.Enabled = false;  
    19.             }  
    20.         }  
     

View Complete Thread