Wednesday, 15 December 2010

AJAX Control Toolkit AsyncFileUpload Error: Unhandled Exception: Server Response Error: 'Unknown Server error'

A new file upload control is recently added to AJAX Control Toolkit.

AsyncFileUpload is an ASP.NET AJAX Control that allows you asynchronously upload files to server. The file uploading results can be checked both in the server and client sides.
You can save the uploaded file by calling the SaveAs() method in a handler for the server UploadedComplete event.

A common error for this control is:
Unhandled Exception: Server Response Error: 'Unknown Server error'

There is a simple workaround to solve this problem. But first of all be sure that you are using its latest version. You can download the latest version from http://www.asp.net/ajaxlibrary/download.ashx

Also be sure that you are using the correct version according to your target .NET framework version.

If you're sure about those two steps and still you get the same error, the simple workaround is to change the value of "ClientIDMode" to "AutoID".

That's all. Enjoy using this great control!