Question

I have a form with text inputs, check boxes, radio buttons, selects and an AsyncFileUpload control.

All of the selects are dynamically populated from the code behind, and one of them has a Select One added (which is removed when another option is selected) from my page controller object.

I have verified that none of the page's javascript is running in conjunction with the upload control other than the script that directly controls the client functionality of the uploader.

If I do not touch any of the other fields and attempt to upload a file I get an Unknown Server Error.
If I change away from the Select One option (which, again, makes the option be removed), I can now upload an image. My solution is to add the option in code behind and remove it once an option is selected from the client, but my question is this:

Why do I get this error? What is the reason for it?

Was it helpful?

Solution

I found the reason. My Select was an asp:DropDownList, and my code was expecting the returned data to be validated. Since I had changed the value from javascript it was no longer the same as what the server had sent, causing the exception I was seeing. The solution is to do those changes from the server instead of on the client. Simple solution to a perplexing issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top