AllFilesFinished event hanlder firing multiple times

Apr 22, 2009 at 4:26 PM
Hi -

  Great control, thanks for making it available on codeplex.

  Here is the issue I found.
  •   Run the the HttpUploader_SilverlightMultiFileUploadTestPage.aspx included in the sample.
  •   Upload two files of identical size
  •   The AllFilesFinished event gets fired twice.    (I put a javascript alert in the javascript AllFilesFinished handler to see the alert message display twice)

  How I ran into this issue is I force an ajax postback after the javascript AllFilesFinished function is called.  I found the ajax postback occurring two times.

  For now I just check to see if were are in an asyncpostback or not before submitting the asncy request.

  I'm new to silverlight development but i'm researching a fix.  Just thought I would see if you could recreate and or if this is an anomaly on my machine.

  Thanks -

  Rob

Coordinator
Apr 22, 2009 at 6:55 PM
Hi,

You're right. I reproduced it.

There's an easy fix for it. You'll need to edit the Silverlight source code. Open the file FileCollection.cs from the Classes folder in the Silverlight project.
Somewhere around line 278 there's a call to AreAllFilesFinished();, remove it! It's also at line 294 and that should be the only place.

I'll fix it in the next release also.

Thanks,
Michiel