Forgive me for just asking to see if anyone else has encountered this issue rather than ripping my application infrastructure apart so that I can upload a test for you guys, but...
I'm using the ASyncUpload on a content page and an AjaxManagerProxy since my AjaxManager is in my master page. My upload is based a lot like the sample where I select an image an upload immediately. After the image is uploaded and processed on the FileUploaded event, I update an asp:image and a RadComboBox. This all seems to be good.
My problem is that the new image filename is added to the combobox and the user is allowed to select the new filename or a pre-existing image filename. When the new file is uploaded, I auto select that filename in the combobox and update the image too. Works fine... However, if I go ahead and select a different file now, the combobox's event fires, but so does the FileUploaded event. ???
The combobox (and a bunch of other controls) on the form are Ajaxified. Any of these postback events will now trigger the FileUploaded event if I've previously uploaded a file.
After the initial FileUploaded event, I clean out the file list by using deleteFileInputAt(0) in javascript, as shown in the example. This does remove it from the client UI. But does this really remove it from the control?
Also, I cannot seem to debug this problem within Visual Studio (2010)'s development server. When I step through the code in the FileUploaded() event, any time I try to access e.File.InputStream, I get an exception that the file is already in use.
This event shouldn't be executing when something else is causing the postback, such as my combobox or checkbox (on a radtree).
My way around this was to catch the exception by calling e.File.SaveAs() with a different filename. If it fails, it's most likely not the proper event that fired. If the SaveAs() is successful, I just rename the file after the successful save since this must be the proper event firing.
So, I have my workaround, but it's very odd behaviour... I really don't have a lot of time to rebuild a test app or start ripping code out so that I can upload what I have, so, I hope I've given enough of a description for you guys to try this and see what you make of it.
Thanks,
J
I'm using the ASyncUpload on a content page and an AjaxManagerProxy since my AjaxManager is in my master page. My upload is based a lot like the sample where I select an image an upload immediately. After the image is uploaded and processed on the FileUploaded event, I update an asp:image and a RadComboBox. This all seems to be good.
My problem is that the new image filename is added to the combobox and the user is allowed to select the new filename or a pre-existing image filename. When the new file is uploaded, I auto select that filename in the combobox and update the image too. Works fine... However, if I go ahead and select a different file now, the combobox's event fires, but so does the FileUploaded event. ???
The combobox (and a bunch of other controls) on the form are Ajaxified. Any of these postback events will now trigger the FileUploaded event if I've previously uploaded a file.
After the initial FileUploaded event, I clean out the file list by using deleteFileInputAt(0) in javascript, as shown in the example. This does remove it from the client UI. But does this really remove it from the control?
Also, I cannot seem to debug this problem within Visual Studio (2010)'s development server. When I step through the code in the FileUploaded() event, any time I try to access e.File.InputStream, I get an exception that the file is already in use.
This event shouldn't be executing when something else is causing the postback, such as my combobox or checkbox (on a radtree).
My way around this was to catch the exception by calling e.File.SaveAs() with a different filename. If it fails, it's most likely not the proper event that fired. If the SaveAs() is successful, I just rename the file after the successful save since this must be the proper event firing.
So, I have my workaround, but it's very odd behaviour... I really don't have a lot of time to rebuild a test app or start ripping code out so that I can upload what I have, so, I hope I've given enough of a description for you guys to try this and see what you make of it.
Thanks,
J