老问题。但是,这对某人会有所帮助。
http://www.andyarnt.net/TinyFileManager.aspx是一个 .net Web 应用程序。也适用于网络表单。您也可以进行一些自定义以使其与 MVC 一起使用。
编辑:
您可以参考Github TinyFileManager.NET中提供的示例应用程序来了解如何配置和参考上述页面中提到的文档。
自定义 CSS 以避免与 Bootstrap 版本发生冲突。3.xx:
div.mce-fullscreen
{
z-index: 1030;
}
div.mce-edit-area
{
border-width: 1px !important;
border-left-width: 0 !important;
border-bottom-width: 0 !important;
}
.mce-combobox .mce-btn
{
width: 44px !important;
height: auto !important;
}
.mce-combobox .mce-btn button
{
padding-right: 0;
padding-left: 0;
}
ASP.net 控制:
<asp:TextBox ID="txtAnnouncements" runat="server" TextMode="MultiLine" AutoComplete="off"
CssClass="form-control elm1"></asp:TextBox>
TinyMCE Javascript:
tfm_path = '/fileman';
tinymce.init({
// document_base_url: "http://localhost:58841/",
// relative_urls: true,
selector: "textarea.elm1",
mode: "specific_textareas",
editor_selector: "tinymce",
theme: "modern",
// width: 300,
height: 300,
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor "
],
// content_css: "css/content.css",
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | forecolor backcolor emoticons | bullist numlist outdent indent | link image | print preview media fullscreen ",
image_advtab: true,
encoding: "xml",
setup: function (editor) {
editor.on("SaveContent", function (i) {
i.content = i.content.replace(/'/g, "&apos");
});
}
});
保存数据库时直接保存,重新绑定到文本框时使用HttpUtility.HtmlDecode()
.