Saving a file

Last post 07-06-2010, 2:58 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  07-04-2010, 7:01 PM 62275

    Saving a file

    I installed the product according instruccions, but at the moment to save on file I don't know where the file go or is stored.  I guess my installation is a evaluation trial, because I downloaded it from you site.
    Filed under:
  •  07-04-2010, 8:11 PM 62276 in reply to 62275

    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
  •  07-05-2010, 7:47 PM 62298 in reply to 62275

    Re: Saving a file

    Thank you for your answer..
     
    My situation is this: I have a file .aspx, I put the control editor inside of the html code, my idea is type  the content and then take the content of the control and send it to my database acces, and then show that content in other aspx file with other information comming from the database, I am working with vb language. Could you please help me with that?
    Filed under:
  •  07-06-2010, 2:58 AM 62306 in reply to 62298

    Re: Saving a file

    Hi jlclavijo,
     
    1. How to load the aspx file into editor
     
    Editor1.LoadFile("~/Default.aspx")
     
    If you need to edit aspx file, I suggest you do the below setting
     
        <CE:Editor ID="Editor1" runat="server" EditCompleteDocument="true" EnableStripScriptTags="false"
                AllowEditServerSideCode="true">
            </CE:Editor>
    2. How to get the content of editor
     
    Editor1.Text
    Editor work with database online example http://cutesoft.net/example/database-example.aspx, you can find the source coed in the download package.
     
    3. How to save the content of editor as a aspx file
     
    Editor1.SaveFile("~/default.aspx")
     
    Regards,
     
    Ken
View as RSS news feed in XML