Re: Customize the look & feel of error message alert window

  •  09-17-2013, 2:39 PM

    Re: Customize the look & feel of error message alert window

    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.

     

    1. <%@ Page Language="C#" AutoEventWireup="True" %>  
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="ajaxuploader" %>  
    4. <html>  
    5. <body>  
    6.     <form id="Form1" runat="server">  
    7.         <CuteWebUI:Uploader runat="server" ID="uploader1">  
    8.             <ValidateOption AllowedFileExtensions="jpg" />  
    9.         </CuteWebUI:Uploader>  
    10.     </form>  
    11.     <script type="text/javascript">  
    12.         function CuteWebUI_AjaxUploader_OnError(msg) {  
    13.             if (msg.indexOf("This file extension is not allowed! File extensions allowed") != -1) {  
    14.                 //show the message you want  
    15.                 alert("this is a custom message");  
    16.                 return false;  
    17.             }  
    18.         }  
    19.     </script>  
    20. </body>  
    21. </html>  
     

    Regards,

     

    Ken 

View Complete Thread