Adding Multiple Files to C1Upload
To add multiple files to C1Upload, set the MaximumFiles property to the number of files you wish to add to C1Upload. For example, the following code sets the MaximumFiles property to 10 so you can add 10 files to C1Upload.
Setting the MaximumFiles property in design view
To set the MaximumFiles property, complete the following steps:
1. Click the Design button to enter Design view.
2. Right-click the C1Upload control to open its context menu and select Properties from the list.
The Properties window opens with the C1Uploads control’s properties in focus.
3. Set the MaximumFiles property to “10”.
4. Press F5 to build the project.
5. Click Add File to add a file to C1Upload. The Choose file dialog box appears. Select the file you want to add to C1Upload and click Open.
The file is added to C1Upload and the file name appears in C1Upload’s File Name textbox.
6. Add nine more files so you have 10 files added to C1Upload. Click Upload to upload all ten files at once.
Setting the MaximumFiles property in source view:
To set the MaximumFiles property, complete the following steps:
1. Click the Source button to enter Source view.
2. Place the MaximumFiles="10" in the <cc1:C1Upload> tag so that the markup resembles the following:
<cc1:C1Upload id="C1Upload1" runat="server"
MaximumFiles="10" />
3. Press the F5 key to build the project.
4. Click Add File to add a file to C1Upload. The Choose file dialog box appears. Select the file you want to add to C1Upload and click Open.
The file is added to C1Upload and the file name appears in C1Upload’s File Name textbox.
5. Add nine more files so you have 10 files added to C1Upload. Click Upload to upload all ten files at once.
Setting the MaximumFiles property in the code-behind file:
In the code-behind, assign the value of the MaximumFiles property to a whole integer, like the following:
1. On the Visual Studio toolbar, click View | Code to enter Code view.
2. Import the following namespace into your project:
Imports C1.Web.UI.Controls.C1Upload
• C#
using C1.Web.UI.Controls.C1Upload;
3. Assign the value of the MaximumFiles property by adding the following code into the Page_Load event:
C1Upload1.MaximumFiles = 10
• C#
C1Upload1.MaximumFiles = 10;
4. Click Add File to add a file to C1Upload. The Choose file dialog box appears. Select the file you want to add to C1Upload and click Open.
The file is added to C1Upload and the file name appears in C1Upload’s File Name textbox.
5. Add nine more files so you have 10 files added to C1Upload. Click Upload to upload all ten files at once.
|