先去下载: 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>