Fix: AsyncFileUpload always return “The file attached is invalid”

If you’re using Microsoft ASP.NET AjaxToolkit’s AsyncFileUpload placed inside a webform nested in a master page, chances are you’ll be faced with a baffling error message “The file attached is invalid”. No amount of manual troubleshooting and breakpoint-ing help because there’s no complete error messages (or even any that makes sense).

The reason: The client side script got confused because it couldn’t find the predicted ClientID.

The solution: Add ClientIDMode=”AutoID” to your markup!

6 thoughts on “Fix: AsyncFileUpload always return “The file attached is invalid””

  1. …which works like a charm, except that I then want to reference that control and I don’t know what the ID is.

Leave a Reply