日期:2014-05-17 浏览次数:21095 次
1.新建项目,建立editer文件夹,在editer文件夹下加入如下文件,目录结构如下:
<!--StartFragment --><link rel="stylesheet" href="editer/themes/default/default.css" /> <link rel="stylesheet" href="editer/plugins/code/prettify.css" /> <script charset="utf-8" src="editer/kindeditor.js"></script> <script charset="utf-8" src="editer/lang/zh_CN.js"></script> <script charset="utf-8" src="editer/plugins/code/prettify.js"></script>?
<script>
KindEditor.ready(function (K) {
var editor1 = K.create('#content1', {
cssPath: 'editer/plugins/code/prettify.css',
uploadJson: 'editer/asp.net/upload_json.ashx',
fileManagerJson: 'editer/asp.net/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
}
});
prettyPrint();
});
</script>
?<textarea id="content1" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;“
runat="server"></textarea>
?5.修改?file_manager_json.ashx,在什么目录结构中,上传文件路径为upload。//根目录路径,相对路径 String rootPath = "/upload/"; //根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/ String rootUrl = "/upload/";?
//文件保存目录路径 String savePath = "/upload/"; //文件保存目录URL String saveUrl = "/upload/";?