Click here to Skip to main content
15,898,954 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I tried many times, but I still can't run the MaximumNumberOfFiles property of AjaxFileUpload.
Whatever the value of MaximumNumberOfFiles (0, 1, 2, 10,...), I can upload as files I want...

Then I tried the demo (where MaximumNumberOfFiles is set to 10) : AjaxFileUpload Demonstration[^]

And...surprise! It doesn't work more!

Could someone please explain me how can i limit the number of files to upload?

Thanks.
Posted
v2

1 solution

Hi there,
its working fine.and please compile it well.use below code for testing
and don't forgate to add AjaxControlToolkit.dll in your references.
on.aspx page:
XML
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SendingMail.WebForm1" %>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body> <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
    <form id="form1" runat="server">
         <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" ThrobberID="myThrobber"
    ContextKeys="fred"
    AllowedFileTypes="jpg,jpeg"
    MaximumNumberOfFiles=10
    runat="server"/>
 </form>
</body>
</html>
 
Share this answer
 
v2
Comments
Member 9887605 7-Mar-13 4:41am    
Hello,

I tested it many times, of course that it's working...
But did you tried to change the MaximumNumberOfFiles property to 2 files?
Is it working for you? can you upload more than 2 files?
In my case, i can still upload files so much i want...
My problem is here!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900