5

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

1 Answer 1

10

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Took me a bit the first time and I've had to show this to people I work with quite a few times
Do you have any links to alternative AJAX file upload solutions?
geekswithblogs.net/rashid/archive/2007/08/01/… is a link to making one yourself. be careful with UpdatePanels, they can be poor performers see: aaron-powell.com/blog.aspx?id=1195 and aaron-powell.com/blog.aspx?id=1209
Also take a look at this for slow performance of an UpdatePanel blogs.msdn.com/tom/archive/2008/09/15/…
Yeah seen your post Tom, I'm a regular reader and have that particular post flagged for keeping ;) Only thing is your method doesn't get around the response size, which can still be very large

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.