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获取编辑器内容 

posted @ 2011-08-19 17:47  虚空境界  Views(250)  Comments(0)    收藏  举报