Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem using the ASP.NET FileUpload control in an UpdatePanel?

Tags:

file

ajax

asp.net

I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine.

Any ideas why this might be happening? And is there a work-around?

Screenshot

like image 589
mattruma Avatar asked Oct 05 '08 11:10

mattruma


1 Answers

To upload a file you need to perform a full ASP.NET page postback, it does not operate over the partial postback method.

You'll need to register the button which "uploads" your file as a PostBackTrigger of the UpdatePanel's triggers.

There are lots of free (and non-free) AJAX file upload solutions, or you can easily create one, it's just a matter of putting your file upload control within an iframe and submitting the iframe page back to the server. It isn't really ajax, but it gives a visual impression of AJAX.

like image 80
Aaron Powell Avatar answered Sep 30 '22 23:09

Aaron Powell