Roman Pelepei gives smart answers on questions about C# .Net, ASP .Net, WPF and Silverlight programming with examples and source code.
вторник, 15 марта 2011 г.
Fixed: 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!