先去下载: http://code.google.com/p/kindeditor/downloads/list
引用: LitJSON.dll文件
<script src="~/kindeditor/kindeditor.js"></script>
@ViewBag.content 编辑的时候使用
<textarea name="TextArea1" id="TextArea1" cols="120" rows="40" >@ViewBag.content</textarea>
//红色区域是后台获取name为TextArea1的值,如果不写 是获取不到的
<script type="text/javascript">
KindEditor.ready(function (K) {
var editor1 = K.create('#TextArea1', {
cssPath: '/kindeditor/plugins/code/prettify.css',
uploadJson: '/kindeditor/tools/upload_json.ashx',
fileManagerJson: '/kindeditor/tools/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
this.sync();
editor.sync();
},
afterBlur: function () {
this.sync();
}
});
});
</script>
本文介绍如何在项目中集成KindEditor富文本编辑器,包括必要的DLL文件引用、脚本引入及配置方法,实现文本编辑和图片上传等功能。
186

被折叠的 条评论
为什么被折叠?



