Showing posts with label Ajax. Show all posts
Showing posts with label Ajax. Show all posts

how to upload multiple images in asp.net

Description
Here i will explain how to upload multiple files in asp.net c#. Also you can display upload progress and status of uploading files. It is simple way to use AjaxFileUpload control for fulfill your all requirement following below.

First of all you need to add below line on top to head part in  your .aspx page :


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
 TagPrefix="asp" %>

After this, put below ScriptManager in .aspx page:


<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

Now add AjaxFileUpload control in your .aspx page like below:


<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
 AllowedFileTypes="jpg,jpeg,png,gif"  MaximumNumberOfFiles="20"
 OnUploadComplete="File_Upload" Width="50%" />