Hi ksanjay,
The example below shows you how to handle the max file limit by javascript. In the example below I set the max to 2.
<%@ Page Language="C#" Title="Customize the queue UI" %>
<%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<script runat="server">
protected void uploader1_UploadCompleted(object sender, UploaderEventArgs[] args)
{
count.Value = uploader1.Items.Count.ToString();
}
protected void uploader1_AttachmentRemoveClicked(object sender, AttachmentItemEventArgs args)
{
count.Value = (uploader1.Items.Count - 1).ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body>
<form id="Form1" runat="server">
<div>
<CuteWebUI:UploadAttachments runat="server" ID="uploader1" OnUploadCompleted="uploader1_UploadCompleted"
OnAttachmentRemoveClicked="uploader1_AttachmentRemoveClicked">
</CuteWebUI:UploadAttachments>
<asp:HiddenField ID="count" runat="server" />
</div>
</form>
</body>
</html>
<script>
var max=2;
var count=document.getElementById("<%= count.ClientID %>").value;
function CuteWebUI_AjaxUploader_OnSelect(files)
{
count=parseInt(count)+files.length;
if(files.length>max||count>max)
{
alert("max files limit is 2");
return false;
}
}
</script>
Regards,
Ken