Is there a way to save text from WebHtmlEditor to an html file? if so can you please show me an example.
Thank you
Naresh.
here is how to do it
private void SaveTextEditorData() { string fileName = "c:\\test1.html";
FileStream outputfile = null; StreamWriter writer = null;
try { outputfile = new FileStream(fileName,FileMode.OpenOrCreate, FileAccess.Write);
writer = new StreamWriter(outputfile);
writer.BaseStream.Seek(0, SeekOrigin.End); DoWrite("<HTML>", writer); DoWrite("<HEAD>", writer); DoWrite("<TITLE>", writer); DoWrite("This HTML file is create in C#", writer); DoWrite("</TITLE>", writer); DoWrite("</HEAD>", writer); DoWrite("<BODY>", writer); DoWrite(this.uxFulfillmentPreviewWebHtmlEditor.TextXhtml, writer); DoWrite("</BODY>", writer); DoWrite("</HTML>", writer); writer.Close();
} catch (Exception ex) { outputfile = null; writer = null; } }
private void DoWrite(String line, StreamWriter writer) { writer.WriteLine(line); writer.Flush(); }
How do trigger the "Save" button?