Re: Problems with catching client side OnChange in Event

  •  11-20-2013, 7:35 AM

    Re: Problems with catching client side OnChange in Event

    Hi,

     

    Please try the example below

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.     protected override void OnLoad(EventArgs e)  
    8.     {  
    9.         editor1.Text = "change something here..";  
    10.         base.OnLoad(e);  
    11.     }  
    12. </script>  
    13.   
    14. <html xmlns="http://www.w3.org/1999/xhtml">  
    15. <head id="Head1" runat="server">  
    16.     <title>Untitled Page</title>  
    17. </head>  
    18. <body>  
    19.     <form id="form1" runat="server">  
    20.         <div>  
    21.             <CE:Editor ID="editor1" runat="server">  
    22.             </CE:Editor>  
    23.             <input type="button" value="check is dirty" onclick="checkIsDirty()" />  
    24.             <script>  
    25.             var editor1=document.getElementById("<%= editor1.ClientID %>");  
    26.             function checkIsDirty()  
    27.             {  
    28.                 if(editor1.IsDirty())  
    29.                 {  
    30.                     alert("is dirty");  
    31.                 }  
    32.             }  
    33.             function CuteEditor_OnChange(editor)  
    34.             {   
    35.               checkIsDirty();  
    36.             }  
    37. </script>  
    38.   
    39.         </div>  
    40.     </form>  
    41. </body>  
    42. </html>  
     

    Regards,

     

    Ken 

View Complete Thread