mattruma
mattruma

Reputation: 16677

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

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

Upvotes: 5

Views: 2805

Answers (1)

Aaron Powell
Aaron Powell

Reputation: 25099

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.

Upvotes: 10

Related Questions