kindeditor-4.1在线编辑器的使用asp.net篇
1、拷入lang、plugins、themes文件夹及所属文件和kindeditor-min.js文件
2、在handler文件夹下创建upload_json.ashx一般处理程序文,并拷入相应的代码
3、修改upload_json.ashx该文件,
//文件保存目录路径
String savePath = "../attached/"; //路径改为"../upload/"
//文件保存目录URL
String saveUrl = aspxUrl + "../attached/";//URL地址改为"../upload/"
showError("上传目录不存在。"); //改为自动创建Directory.CreateDirectory(dirPath);
文件中的链接
<script src="../kindeditor/kindeditor-min.js" type="text/javascript"></script>
<script src="../kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
KindEditor.ready(function (K) {
var editor1 = K.create('#<%=txtbody.ClientID %>', {
uploadJson: '../handler/upload_json.ashx',
allowFileManager: true,
items: [
'source', '|', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>