Hi,
Please try the example below. It shows you how to catct the "This file extension is not allowed! File extensions allowed" error and achieve your own logic there. The example below will shows the custom alert message.
- <%@ Page Language="C#" AutoEventWireup="True" %>
-
- <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="ajaxuploader" %>
- <html>
- <body>
- <form id="Form1" runat="server">
- <CuteWebUI:Uploader runat="server" ID="uploader1">
- <ValidateOption AllowedFileExtensions="jpg" />
- </CuteWebUI:Uploader>
- </form>
- <script type="text/javascript">
- function CuteWebUI_AjaxUploader_OnError(msg) {
- if (msg.indexOf("This file extension is not allowed! File extensions allowed") != -1) {
-
- alert("this is a custom message");
- return false;
- }
- }
- </script>
- </body>
- </html>
Regards,
Ken