Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 21, 2008 07:49 PM by malachi151
Jan 17, 2008 04:16 PM|LINK
I'm aware of the fact that the FileUpload control is not compataible with asyc postbacks, and that the way to use the FileUpload control inside an UpdatePanel is to create a PostBack trigger that causes a full postback when the button you want is submitted,
as shown below.
But what do you do when you are using a FormView or other such template based control? When using a template based control, like FormView, the control that you needs to create the trigger for doesn't really exist, so you can't just create a trigger and set
the ControlID to the ID of the button in the FormView, because that button doesn't always exist. So, how do you deal with this?
Jan 17, 2008 07:10 PM|LINK
I struggled with this compatibility issue. I use a file upload to upload pictures. Below is my code, I hope it helps. It is used in the same situation as what you described, an UpdatePanel contained in a FormView.
Jan 18, 2008 02:26 AM|LINK
FileUpload control are not compatible with UpdatePanel when it is used to upload files as part of an asynchronous postback.
See here building AJAX enabled File Upload control
Jan 21, 2008 07:49 PM|LINK
Thank you, but none of the posted solutions, as far as I can tell, address my question.
The issue is having a FileUpload control, along with other controls, inside an FormView, which is inside an UpdatePanel.
The IFrame solution, as far as I can tell, doesn't work in this situation, because I can't put the IFrame inside the FormView, inside the UpdatePanel, and even if I could, I couldn't reference the controls by name as the examples show because they are inside
As for the first suggestion, it is not the same as my situation. My situation is not an UupdatePanel inside a FormView, it is a FormView inside an UpdatePanel. In this example the FileUpload works without any fancy tricks because it is outside the UpdatePanel.
What I am looking for is a way to use a FileUpload field that, along with many other fields, is part of a FormView, which is inside an Ajax TabContainer, which is inside an UpdatePanel.
As far as I can see, neither the PostBackTrigger method nor the IFrame method works in this situation. Perhaps there is a way to create the proper PostBackTrigger at run time, after during one of the events in the FormView, but I'm not sure if that is possible,
or hwo to do it.