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
- Create SaveContent() method in client-side to invoke FlyPostBack
request.
function SaveContent()
{
var rte = ISGetObject("WebTextEditor1");
rte.SaveContent();
}
|
- Place the following code in WebTextEditor's Save server-side event
to save content.
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();
}
|
- Invoke SaveContent() using HTML button.
<input id="Button1" type="button" value="Save Content" onclick="SaveContent()"
/>
- Run the project.