Please check this sample code :
-
<%@ Page Language="C#" Title="Total Progress" %>
-
<%@ Import Namespace="CuteWebUI" %>
-
<%@ 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">
-
-
void InsertMsg(string msg)
-
{
-
ListBoxEvents.Items.Insert(0, msg);
-
ListBoxEvents.SelectedIndex = 0;
-
}
-
protected void UploadAttachments1_AttachmentAdded(object sender, AttachmentItemEventArgs args)
-
{
-
InsertMsg("Added.." + args.Item.FileName);
-
}
-
-
</script>
-
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head id="Head1" runat="server">
-
</head>
-
<body>
-
<form id="Form1" runat="server">
-
<CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1" OnAttachmentAdded="UploadAttachments1_AttachmentAdded">
-
</CuteWebUI:UploadAttachments>
-
<div id='progressInfo' style="display:none;font-size:18px;color:DarkRed"></div>
-
<br />
-
<div>
-
Server Trace:
-
<br />
-
<asp:ListBox runat="server" ID="ListBoxEvents" Width="800"></asp:ListBox>
-
</div>
-
</form>
-
<script type="text/javascript">
-
var uploader=document.getElementById('<%=UploadAttachments1.ClientID %>');
-
function CuteWebUI_AjaxUploader_OnQueueUI(list)
-
{
-
if(list.length<2)return;
-
-
var errorcount=0;
-
for(var i=0;i<list.length;i++)
-
{
-
var size=list[ i ].FileSize; //or -1 if iframe mode
-
var stat=list[ i ].Status;
-
-
if(stat=="Cancel"||stat=="Error")
-
errorcount++;
-
}
-
if(errorcount==list.length)
-
{
-
setTimeout(uploader.reset,1);
-
}
-
}
-
</script>
-
-
</body>
-
</html>
Regards,
Terry