我正在使用 asp.net 和 c# 构建一个可以上传、编辑、保存文件的网站。我使用 tinymce 作为文本编辑器,但问题是我不知道如何在 tinymce 中配置保存插件。我添加了 asp 按钮以用作保存按钮,但如何配置它以保存到文件 .html 中?
用 texeditor 替换 tiny 的 JavaScript:
$('#<%=btnsave.ClientID%>').show() //save button
tinymce.init({selector: "textarea"}); //replace texteditor
这是标记代码:
<textarea name="textarea" cols="100" rows="5" style="visibility: hidden;">
</textarea>
<br /><asp:Button Text="Save" runat="server" ID="btnsave" style="display:none;" onclick="btnsave_Click" />
这在后面的代码中
protected void btnsave_Click(object sender, EventArgs e)
{
string path = Server.MapPath("~/WordExcelPPointToHtml/test.html");
File.WriteAllText(path,HtmlTextArea); //this line have error!!
}
谁可以帮我这个事 ?。提前致谢。急切地等待答案。