zoukankan      html  css  js  c++  java
  • CKEditor3.6.1+CKFinder2.0.2结合 打造"帅"的编辑器 For .Net

    原文见曾祥展的博客,做了一些细化和删改。

    1,将ckeditor解压打开,打开_Samples,将ckeditor文件夹拷贝项目中的根目

    录下

    2,将ckfinder解压,ckfinder文件夹拷贝项目中的根目录下,把_sample,

    _source,help文件夹删除掉,(注:没有用)

    3.添加CKFinder.dll和CKEditor.NET.dll引用

    4.在工具箱中添加CKEditorControl工具

    5.将CKEditorControl工具拖入到aps.net页面中,并在页面的后台代码中加入

    using CKFinder引用。并写入如下代码:
     protected void Page_Load(object sender, EventArgs e)
            {
                CKFinder.FileBrowser _filebowser = new FileBrowser();
                _filebowser.SetupCKEditor(this.CKEditorControl1);

    //CKEditor控件内就可使用CKFinder了
                //_filebowser.BasePath = "/ckfinder/";
            }

    6.修改ckfinder/config.ascx 文件内容:
    public override bool CheckAuthentication()
    {
     //return false; 改这里
       // return HttpContext.Current.User.Identity.IsAuthenticated; 更安全
        return true;
    }

    SetConfig():

     BaseUrl = "~/ckfinder/userfiles/"; //此处设定客户端上传的文件

    储存在服务器的哪个文件夹内。如:BaseUrl = "~/uploadfiles/";

    7.使用CKEditorControl1.Text获取编辑器内容 

  • 相关阅读:
    1新随笔
    MySQL--DML语言
    记一下Spring整合MyBatis踩的坑
    MyBatis(二)动态sql
    Mybatis动态代理注意事项
    几个练习指法和盲打的网站
    友链
    博客初心&心情小计
    博客园美化之标题显示
    博客园美化鼠标点击效果【富强民主文明和谐……】
  • 原文地址:https://www.cnblogs.com/ahuang1118/p/2146034.html
Copyright © 2011-2022 走看看