Ajax introduces a new approach to WebPages that update the portion of a the page by a techniques called Partial-page rendering. The Ajax Control Toolkit contains controls that you can use to build highly responsive and interactive Ajax-enabled Web applications. AsyncFileUpload is an ASP.NET AJAX Control that allows you asynchronously upload files to server, it uploads the file without any postback. The file uploading results can be checked both in the server and client sides.

You can show the loading image while file uploading is in progress. Also you can save the uploaded file by calling the SaveAs() method in a handler for the server UploadedComplete event.
C# if (AsyncFileUpload1.HasFile)
{
AsyncFileUpload1.SaveAs(@"C:\upload\" + AsyncFileUpload1.FileName);
}
If AsyncFileUpload1.HasFile Then
AsyncFileUpload1.SaveAs("C:\upload\" + AsyncFileUpload1.FileName)
End If
The following Asp.Net Ajax program shows how to integrate an AsyncFileUpload to your web application. To use the Ajax Control Toolkit in your Visual Studio project, you should add reference to the AjaxControlToolkit.dll in your project.
Default.aspx
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> Untitled Page
Click the following links to see full source code
Advertisement