• 配置参考文档,主要将ckeditor中的(adapters、images、lang、plugins、skins、themes、ckeditor.js、config.js、contents.css)解压到js目录,然后“显示所有文件”,将ckeditor的目录“包含在项目中”,在发帖页面引用ckeditor.js,然后设置多行文本框的class="ckeditor"(CSS强大)(服务端控件CssClas=" ckeditor ",客户端控件要设定cols、rows属性,一般不直接用html控件),代码中仍然可以通过TextBox控件的Text属性来访问编辑器内容。
  • 由于页面提交的时候asp.net会把富文本编辑器中的html内容当成攻击内容,因此需要在aspx中的Page标签中设置 ValidateRequest="false" 来禁用攻击检测(2010中还要根据报错信息修改WebConfig来禁用XSS检测)。
  • CKFinder是一个CKEditor插件,用来为CKEditor提供文件的上传的功能。将bin\Release下的CKFinder.dll添加到项目的引用;将core、ckfinder.js、ckfinder.html、config.ascx解压到CKFinder自己的目录。按照文档修改CKEditor的config.js,将上传的处理程序设定为CKFinder,注意路径的问题。
  • 使用测试,在插入超链接、插入图片、插入文件中都有“上传”
  • 因为上传文件是非常危险的动作,因此在文件上传的时候会进行权限校验。在config.ascx的CheckAuthentication方法中校验是否有权限上传,返回true表示有权限,否则没有权限,一般修改成判断用户是否登录,并且登录用户是有上传权限的用户,可以用Session或者Membership来做。思考:如何实现只有指定IP地址的用户才能上传?
  • 在SetConfig函数中设置上传文件夹的位置BaseUrl、缩略图的位置,每种类型数据的上传路径、允许上传的文件类型AllowedExtensions等。

为了使用ckfinder还需要在vs2010的web.config中加入
 <!--为了使用ckeditor-->
        < pages validateRequest ="false " />
        < httpRuntime requestValidationMode ="2.0 " />
 <!-- 为a了使用ckeditor -->
以及



  • 使用ckfinder的配置,在ckeitor的config.js文件中加入如下
  • 还需要复制出“CKFinder.dll”添加到项目的引用中

var ckfinderPath = "/SCDAadmin/js" ;
    config.filebrowserBrowseUrl = ckfinderPath + '/ckfinder/ckfinder.html';
    config.filebrowserImageBrowseLinkUrl = ckfinderPath + '/ckfinder/ckfinder.html?Type=Images' ;
    config.filebrowserFlashBrowseLinkUrl = ckfinderPath + '/ckfinder/ckfinder.html?Type=Flash' ;
    config.filebrowserUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files' ;
    config.filebrowserImageUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images' ;
    config.filebrowserFlashUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash' ;


这时候还是有安全限制

打开ckfinder的config.ascx
修改里面的
public override bool CheckAuthentication()
       {
               // WARNING : DO NOT simply return "true". By doing so, you are allowing
               // "anyone" to upload and list the files in your server. You must implement
               // some kind of session validation here. Even something very simple as...
               //
               //            return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
               //
               // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
               // user logs on your system.
              object obj = Session["admin_login" ];
        if (obj != null && Convert.ToBoolean(obj) == true)
            return true ;
        else
            return false ;
               return false ;
               }


Ckeditor配置的更多相关文章

  1. CKeditor 配置使用

    CKeditor 配置使用 一.使用方法:1.在页面<head>中引入ckeditor核心文件ckeditor.js<script type="text/javascrip ...

  2. MVC5富文本编辑器CKEditor配置CKFinder

    富文本编辑器CKEditor的使用 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: ...

  3. 富文本编辑器 CKeditor 配置使用+上传图片

    参考文献: 富文本编辑器 CKeditor 配置使用 CKEditor与CKFinder的配置(ASP.NET环境),老版本可以参考 CKEditor+CKFinder ASP版在本地电脑中的配置  ...

  4. ckeditor、ckeditor配置--整合

    1.将ckeditor和ckfinder文件夹拷入项目文件夹中,刷新项目. 2.ckfinder把文件夹中的bin目录下的dll文件(CKFinder.dll)添加到网站的引用中,防止出现找不到类的错 ...

  5. CKEditor配置及使用

    注:使用CKEditor版本为js版本的CKEditor 4,所有配置均参考自CKEditor官方API:http://docs.ckeditor.com/,以及实践经验 一.快速使用 1.引入CKE ...

  6. 富文本编辑器 CKeditor 配置使用 (带附件)

    Ckeditor下载地址:http://ckeditor.com/download 1.CKeditor的基本配置 var textval=CKEDITOR.instances.TextArea1.g ...

  7. 富文本编辑器 CKeditor 配置使用

    作者:Tyler Ning出处:http://www.cnblogs.com/tylerdonet/本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连 ...

  8. struts2+ckeditor配置图片上传

    又是一个漫漫长夜. 公司的编辑器坏了,用的是百度编辑器,上传图片的网址被框架给拦截了,我们本地怎么测试都没问题,放到服务器就这样了.和老李找了半天,疯了,没原因的. 笔者以前用过jsp+ckedito ...

  9. CKEditor+SWFUpload实现功能较为强大的编辑器(一)---CKEditor配置

    CKEditor爆表的强大功能大家都有目共睹,号称最强大的在线编辑器,只要将文件复制到项目中,在添加引用,在一句代码就可以将普通的textarea变成华丽的编辑器 所谓一复制,一拖,一换就大功告成 但 ...

随机推荐

  1. ZZNU 1163: 在线判题(指针专题)

    题目描述 Ignatius is building an Online Judge, now he has worked out all the problems except the Judge S ...

  2. thinkphp 注册验证

    遇到用户注册等情况时,如果等用户输入所有信息,点击注册按钮提交后,再验证输入是否正确,体验很不好,而且很浪费用户的时间,增加注册成本,这里提供一个例子,演示了怎么使用ajax进行单步验证,使用thin ...

  3. 第四节,Linux基础命令

    第四节,Linux基础命令 命令是系统操作员对系统传入的指令,传入指令后回车,系统接收到指令做出相应的行为 1.查看用户位于系统什么位置 [pmd]检查操作用户位于系统的什么位置 命令         ...

  4. SLF4J 教程

    转自:SLF4J 教程 一.介绍:简单日记门面(simple logging Facade for java)SLF4J是为各种loging APIs提供一个简单统一的接口,从而使得最终用户能够在部署 ...

  5. /tmp 和 /var/tmp 的区别

    /tmp is meant as fast (possibly small) storage with a short time to live (TTL). Many systems clean / ...

  6. js 对象 视频 插入元素

    <!DOCTYPE html><html lang="en"><head>  <meta charset="UTF-8" ...

  7. 使用 Spark MLlib 做 K-means 聚类分析[转]

    原文地址:https://www.ibm.com/developerworks/cn/opensource/os-cn-spark-practice4/ 引言 提起机器学习 (Machine Lear ...

  8. visual studio2013 改变匹配括号的颜色

    改变匹配括号的颜色实现如下效果

  9. [SOJ] 1282. Computer games (KMP)

    坑爹题 1282. Computer Game Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Brian is an ...

  10. [ An Ac a Day ^_^ ] CodeForces 468A 24 Game 构造

    题意是让你用1到n的数构造24 看完题解感觉被样例骗了…… 很明显 n<4肯定不行 然后构造出来4 5的组成24的式子 把大于4(偶数)或者5(奇数)的数构造成i-(i-1)=1 之后就是无尽的 ...