• 配置参考文档,主要将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. 解决ubuntu下的firefox无法在线播放音频和视频的问题

    一贯无视 Linux 平台的腾讯(无贬义)理所当然地没有开发QQ音乐Linux版,于是想尝试QQ音乐网页版,结果发现歌曲无法播放.刚开始以为是腾讯还在网页版上用万恶的 Windows Media Pl ...

  2. geekNews 学习总结

    1:下移隐藏,上移出现 //android.support.v4.widget.NestedScrollView nsvScroller; //FrameLayout llDetailBottom; ...

  3. ZZNU 1993: cots' friends

    题目描述 cot 最近非常喜欢数字, 喜欢到了什么程度呢, 已经走火入魔了.... cot把每个朋友编上一个序号,然后遇到谁就叫"XX号",对此,他的朋友们一致认为cot" ...

  4. intellij idea 12 搭建maven web项目 freemarker + spring mvc(续)

    上次有2个东西没整明白,一个就是controller的注解使用RequestMappingHandlerAdapter报错 No adapter for handler [controller.Use ...

  5. ACdream 1020 The Game about KILL

    找规律. 11 3 1 3 5 7 1 3 5 7 9 11 13 15 ....... #pragma comment(linker, "/STACK:1024000000,1024000 ...

  6. 第九十三节,html5+css3移动手机端流体布局,基础CSS,头部设计,轮播设计,底部设计

    html5+css3移动手机端流体布局,基础CSS,头部设计,轮播设计,底部设计 基础CSS 首先将通用css属性写好 @charset "utf-8"; /*通用样式*/ /*去 ...

  7. Eclipse使用Maven tomcat:run命令启动web项目

    Eclipse安装好m2e插件,使用Maven构建项目后,启动web项目就行就非常简单了,你不再需要下载然后在eclipse中配置tomcat. 右键你的项目 -> Run As -> R ...

  8. Java 工具 JUnit单元测试

    Java 工具 JUnit单元测试 @author ixenos 1.1.   JUnit单元测试框架的基本使用 一.搭建环境: 导入junit.jar包(junit4) 二.写测试类: 0,一般一个 ...

  9. 浙大 pat 1024题解

    1024. Palindromic Number (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A ...

  10. Java 相关注意事项小结

    程序是一系列有序指令的集合: Java主要用于开发两类程序: 1)桌面应用程序2)Internet应用程序1,Java程序:三步走,编写--编译--运行:2,使用记事本开发:1)以.java为后缀名保 ...