Re: Saving a file

  •  07-04-2010, 8:11 PM

    Re: Saving a file

    Hi jlclavijo,
     
    By default, the "save" button will not save file to anywhere.
     
    You can handle the save logic in method "PostBackCommand". This method will be triggered after you click on the "Save" button.
     
    Below is an example to show you how to save the content as a file.
     
    1. <%@ Page Language="C#" Debug="true" %>   
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="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. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head id="Head1" runat="server">   
    7.     <title>Untitled Page</title>   
    8.   
    9.     <script runat="server">      
    10.         protected void Editor1_PostBackCommand(object sender, CommandEventArgs e)   
    11.         {   
    12.             Editor1.SaveFile("~/myFile.txt");   
    13.         }   
    14.     </script>   
    15.   
    16. </head>   
    17. <body>   
    18.     <form id="form1" runat="server">   
    19.         <CE:Editor ID="Editor1" runat="server" OnPostBackCommand="Editor1_PostBackCommand">   
    20.         </CE:Editor>   
    21.     </form>   
    22. </body>   
    23. </html>  
     
    Regards,
     
    Ken
View Complete Thread