学无止境详情

ASP.NET使用在线编辑器

发表:2015-10-05    编辑:南昌开优网络    浏览:4607    
标签:ASP.NET应用

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>

分享
  1. 上一篇:ASP.NET 自由裁剪图片
  2. 下一篇:ASP.NET QQ登录接口