Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Re: Validating and providing feedback
Re: Validating and providing feedback
11-16-2009, 9:45 PM
cutechat
Joined on 07-22-2004
Posts 2,332
Re: Validating and providing feedback
Reply
Quote
Hi,
You have two solution :
1 , throw an exception in the event handler, and uploader will show the exception message.
2 , try this way :
<%@ Page Language="C#" %> <%@ Import Namespace="CuteWebUI" %> <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void UploadAttachments1_FileValidating(object sender, UploaderEventArgs args) { //you can send some data or message to client side UploadAttachments1.SetValidationServerData("File validated at " + DateTime.Now.ToString("HH:mm:ss")); //updating the UI has no effect! labelMsg.Text = "Validated!"; } protected void UploadAttachments1_FileUploaded(object sender, UploaderEventArgs args) { } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1" InsertText="Add files" OnFileValidating="UploadAttachments1_FileValidating" OnFileUploaded="UploadAttachments1_FileUploaded"> </CuteWebUI:UploadAttachments> <br /> <asp:Label runat="server" ID="labelMsg" /> </div> </form> </body> <script type="text/javascript"> function CuteWebUI_AjaxUploader_OnTaskComplete(file) { //You can get the custom data here , (or using uploader.getitems()[i].ServerData) alert(file.ServerData); } </script> </html>
Regards,
Terry
View Complete Thread