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:
- <asp:Button ID="btnMultipleAttachment" runat="server" Text="Browse" CssClass="button" />
- <CuteWebUI:UploadAttachments runat="server" ID="ajaxBinaryAttach" InsertButtonID="btnMultipleAttachment" OnUploadCompleted="enableSubmitBtn" OnAttachmentRemoveClicked="disableSubmitBtn">
- <ValidateOption MaxSizeKB="153600" AllowedFileExtensions="iso,zip,png,bmp,xml" />
- </CuteWebUI:UploadAttachments>
- <asp:Button ID="btnSubmitMultiple" runat="server" Text="Submit attachments" visible="true" Enabled="false" OnClick="btnSubmitMultiple_Click" />
-
- void enableSubmitBtn(object sender, UploaderEventArgs[] args)
- {
-
- btnSubmitMultiple.Enabled = true;
-
- }
-
- void disableSubmitBtn(object sender, AttachmentItemEventArgs args)
- {
- if (ajaxBinaryAttach.Items.Count == 0)
- {
- btnSubmitMultiple.Enabled = false;
- }
- }