How do capture the Save Click Even in VB for CuteEditor ASP.NET

Last post 07-31-2012, 8:09 AM by Kenneth. 8 replies.
Sort Posts: Previous Next
  •  07-14-2012, 10:04 PM 74140

    How do capture the Save Click Even in VB for CuteEditor ASP.NET

    How do capture the Save Click Even in VB for CuteEditor ASP.NET
     
    If am doing the following but its not working
     
    If Editor1.TemplateItemList.Equals("Save") Then
                MsgBox("Save Clicked", MsgBoxStyle.Information, "Save Clicked")
    End If
  •  07-16-2012, 7:23 AM 74141 in reply to 74140

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Hi vanavah,
     
    Please try the example below
     
    1. <%@ Page Language="VB" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    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.   
    8.     Protected Sub editor1_PostBackCommand(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.CommandEventArgs)  
    9.         label1.Text = "save clicked!"  
    10.     End Sub  
    11. </script>  
    12.   
    13. <html xmlns="http://www.w3.org/1999/xhtml">  
    14. <head runat="server">  
    15.     <title>Untitled Page</title>  
    16. </head>  
    17. <body>  
    18.     <form id="form1" runat="server">  
    19.         <div>  
    20.             <CE:Editor ID="editor1" runat="server" OnPostBackCommand="editor1_PostBackCommand">  
    21.             </CE:Editor>  
    22.             <asp:Label ID="label1" runat="server"></asp:Label>  
    23.         </div>  
    24.     </form>  
    25. </body>  
    26. </html>  
    You also can refer to online example at http://www.cutesoft.net/example/howto/CatchSave/cs/capture_save_button_click.aspx. You can find the source code of it in the editor download package "how to" folder.
     
    Regards,
     
    Ken 
  •  07-27-2012, 6:12 AM 74283 in reply to 74141

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Hello Ken, can you provide an example of capturing Save event on Client Side using JavaScript? the example link you provide doesn't work. Thanks.
  •  07-27-2012, 7:07 AM 74284 in reply to 74283

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Hi chemist,
     
    Please try the example below 
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <html xmlns="http://www.w3.org/1999/xhtml">  
    7. <head runat="server">  
    8.     <title>example</title>  
    9. </head>  
    10. <body>  
    11.     <form id="form1" runat="server">  
    12.         <CE:Editor ID="Editor1" runat="server">  
    13.         </CE:Editor>  
    14.     </form>  
    15. </body>  
    16. </html>  
    17. <script>  
    18. function CuteEditor_OnCommand(editor,command,ui,value)  
    19.  {  
    20.     if(command=="PostBack")  
    21.     {  
    22.         alert("save!");  
    23.     }  
    24. }  
    25.   
    26. </script>  
    Regards,
     
    Ken 
  •  07-30-2012, 2:09 AM 74297 in reply to 74283

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Yes, when will this be released. I was promised version 7.0 to fix this last month and still nothing. Meanwhile my clients are complaining about this issue still... Please let us  know when we can expect this new version.
    __________
  •  07-30-2012, 4:59 AM 74300 in reply to 74284

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Thanks Ken for the quick reply, but this doesn't work on my side. I've created a custom Configuration file and set ConfigurationPath. wiiting this method just, causes full post back. I'm using CuteEditor 6.6. What I'm missing? Thanks.
  •  07-30-2012, 8:08 AM 74301 in reply to 74300

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Hi chemist,
     
    Sorry, but I am not very clear about your problem. Whatever what configuration file you using, the "save" button will fire the function I provided. First it will fire the client side javascript funtion, then fire the server side "PostBackCommand" event. This is what the save button do.
     
    If you do not want it fire the server side event, please return true in the CuteEditor_OnCommand funtion, like
     
    <script>
    function CuteEditor_OnCommand(editor,command,ui,value)
     {
        if(command=="PostBack")
        {
            alert("save!");
            return true;
        }
    }
    </script>
     
    Regards,
     
    Ken 
  •  07-31-2012, 5:30 AM 74315 in reply to 74301

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Thanks Ken, I found the bug. If I place CE inside a jquery ui dialog, then this bug is introduced. That is, first time clicking save causes to be posted back, not JS Code executes. But, subsequent clicks on save cause to execut JS Code properly. Any workaround? Thanks.
  •  07-31-2012, 8:09 AM 74316 in reply to 74315

    Re: How do capture the Save Click Even in VB for CuteEditor ASP.NET

    Hi chemist,
     
    Can you create an example page which can reproduce this issue and send it to me? So we can check it.
     
     
    Regards,
     
    Ken 
View as RSS news feed in XML