Intersoft Support Center

Save Content in FlyPostBack

WebTextEditor can perform save operation programmatically from client-side. When client-side API is used, WebTextEditor used FlyPostBack (AJAX) request to perform the save operation without the needs for page refresh.

This topic will show you how to save content in FlyPostBack.

To save content in FlyPostBack

  1. Create SaveContent() method in client-side to invoke FlyPostBack request.
    JavaScript Copy ImageCopy Code
    function SaveContent()
    {
       var rte = ISGetObject("WebTextEditor1");              
       rte.SaveContent();
    }     
                            

  2. Place the following code in WebTextEditor's Save server-side event to save content.
    C# Copy ImageCopy Code
    protected void WebTextEditor1_Save(object sender, ISNet.WebUI.WebTextEditor.WebTextEditorSaveArgs e)
    {
       StreamWriter sw = new StreamWriter(Server.MapPath("./SampleHtml/SaveContentFlyPostBack.html"), false, System.Text.Encoding.Default);
       sw.Write(e.Content);
       sw.Flush();
       sw.Close();
    }   
                            

  3. Invoke SaveContent() using HTML button.

    <input id="Button1" type="button" value="Save Content" onclick="SaveContent()" />

  4. Run the project.
Previous Next