Hi microcontroleur,
The example below shows you how to catch the error message of uploader and use your own method to show you own message.
- <%@ Page Language="C#" %>
-
- <!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>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CuteWebUI:UploadAttachments ID="attachment1" runat="server" InsertText="Upload1">
- <ValidateOption MaxSizeKB="10" />
- </CuteWebUI:UploadAttachments>
- <asp:Label ID="errorMessage" runat="server"></asp:Label>
- </form>
- </body>
- </html>
-
- <script>
- function CuteWebUI_AjaxUploader_OnError(msg)
- {
-
- if(msg.indexOf("is too large")!=-1)
- {
-
- var errorMessage=document.getElementById("<%= errorMessage.ClientID %>");
- errorMessage.innerHTML="The file is too large";
- return false;
- }
- }
- </script>
Regards,
ken