I made a simple page with an ig:WebUpload control, a couple of dropdown lists, and some radio buttons. I have the uploader set to upload as a memory stream.
The idea is that a user will select which file they are submitting, whether they want to replace or update their data, then upload a CSV file and I will process it differently depending on which options they choose.
The problem is that no matter what options are chosen, either by dropdown or by radio button, inside the UploadFinishing event the dropdown lists show selected index of 0 and none of the radio buttons report as being selected. Once the UploadFinishing event is complete all of the controls show the correct options selected.
I've tried adding a hidden label or hidden field that will get a value when a radio button or a dropdown list is clicked. The value does write to the hidden field, but once I'm inside the UploadFinishing code that hidden label or field is blank.
Is there some way for me to read controls on my page as the upload is finishing up?
My sample project is attached. Please tell me what I'm doing wrong.
Hello Matt,
When you are using WebUpload1_UploadFinishing event and trying to get the status of the other control it is showing that controls are not been set and it is expected behavior because while uploading the file there is no post back happen and the status of the other controls are not being set.
Therefore, to get the status of the other controls while uploading a file you could use client side event and create a post back. To get the client side event you can refer the below link:https://ko.infragistics.com/help/aspnet/webupload-using-client-side-events
Please let me know if the provided approach would help to achieve your requirement.
I'm not exactly certain how this would work.
I added a second FIleUpload control to the page and set this one to call the Javascript client function (I tried FileSelected, FileUploading, and FileUploaded)
In that function I have it read the dropdown lists and radio buttons and it does capture the correct info. I then have it do a page postback. But by the time it gets to the Server-Side fileUploading handler the controls are back to their default values again.
I need to read the file in as a memory stream, convert that to a string, process it, and then insert the results into a database. I can't do all of that through javascript, so at some point I need to run the server-side code to actually process the file, and I need to process it differently depending on what options were selected by the user.