下载地址:百度编辑器
1.首先要把下载的包导入到你的项目里,然后在界面里添加引用:utf8-net/lang/zh-cn/zh-cn.js;utf8-net/ueditor.all.min.js;utf8-net/ueditor.config.js
2. js中加载:
var purchaseeditor_a;
var purchaseeditorOption = {
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars: [[
'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
'print', 'searchreplace', 'help', 'drafts'
]],
//'preview',
//focus时自动清空初始化时的内容
// autoClearinitialContent: true,
//关闭elementPath
elementPathEnabled: false,
scaleEnabled: true,
//不自动保存
enableAutoSave:false
};
purchaseeditor_a = new baidu.editor.ui.Editor(purchaseeditorOption);
purchaseeditor_a.render('contents');
purchaseeditor_a.ready(function () {
});
3.关于弹出界面被遮盖:
$('.window-mask').css('z-index', '999');
$('.window-shadow').css('z-index', '1000');
$('.panel').css('z-index', '1001');
4.关于图片不显示:
找到config.json中配置
"imageUrlPrefix": "/--路径--/", /* 图片访问路径前缀 */
5.关于HTML标签存数据库中MVC报危险的值存不进去:
--web.config中加入
</system.web>
--controller里添加
[ValidateInput(false)]
[HttpPost]
--界面添加
<%@ Page Language="C#" validateRequest="false"%>