Chinaunix首页 | 论坛 | 博客
  • 博客访问: 80456
  • 博文数量: 64
  • 博客积分: 1545
  • 博客等级: 上尉
  • 技术积分: 392
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-23 15:23
文章分类

全部博文(64)

文章存档

2013年(1)

2012年(63)

我的朋友

分类: 嵌入式

2012-11-02 23:52:02

一、官方Download

1、 :点击CKEditor.NET标题下的“Download zip”按钮

此处使用当前最新版本“CKEditor.NET 3.5.2, released on 7 March 2011”

2、 :点击Asp.net标签下的“Download zip”或者“Download tar.gz”按钮(PS:两个按钮下载的内容一样,说明

此处使用当前最新版本“version: 2.0.2, updated 03.03.2011”

——CKEditor是新一代的FCKEditor,很明显的不同点是CKEditor中文件上传功能独立出来了,需要配合使用CKFinder才能实现。

 

二、具体配置顺序

1、在项目中添加对应的文件

右击网站,添加引用。依次添加两个文件夹中“\bin\Debug” 中的dll文件——CKEditor.NET.dll、CKFinder.dll

2、将文件夹“ckeditor”、“ckfinder”添加到网站的根目录下

注意,下载的文件中包括很多用不到的文件,可以稍微清理一下:

此版本对于CKEditor只需要“\_Samples”文件夹下的“ckeditor”文件夹即可,其余都可不要。

_source文件夹(源程序文件,可以删除)
changes.html(更新列表,可以删除)
install.html(安装指向,可以删除)
license.html(使用许可,可以删除)

3、修改配置文件

(1)CKEditor配置:打开“ckeditor\config.js”文件,根据需要添加配置信息

CKEDITOR.editorConfig = function(config) {

config.skin = 'v2'; //选择皮肤,源文件在“ckeditor\skins\”中
config.resize_enabled = false;

// 基础工具栏
// config.toolbar = "Basic";   
// 全能工具栏
// config.toolbar = "Full";   
// 自定义工具栏
config.toolbar =
[
['Source', '-', 'Preview'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'ShowBlocks'], '/',
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'], '/',
['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor'], ['Maximize', '-', 'About']
];

}

(2)在CKEditor中集成CKFinder,注意对应文件的路径

将下面的内容继续添加到“ckeditor\config.js”文件中

CKEDITOR.editorConfig = function(config) {
……
config.filebrowserBrowseUrl = 'ckfinder/ckfinder.html'; //不要写成"~/ckfinder/..."或者"/ckfinder/..." config.filebrowserImageBrowseUrl = 'ckfinder/ckfinder.html?Type=Images'; config.filebrowserFlashBrowseUrl = 'ckfinder/ckfinder.html?Type=Flash'; config.filebrowserUploadUrl = 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'; config.filebrowserImageUploadUrl = 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; config.filebrowserFlashUploadUrl = 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; config.filebrowserWindowWidth = '800'; //“浏览服务器”弹出框的size设置 config.filebrowserWindowHeight = '500';
}
CKFinder.SetupCKEditor(null, '../ckfinder/');//注意ckfinder的路径对应实际放置的位置
 (3)CKFinder的配置:

打开“ckfinder\”下的用户控件config.ascx,更改其BaseUrl路径:

BaseUrl = "~/ckfinder/userfiles/";//or BaseUrl = "ckfinder/userfiles/";

并且更改:

public override boolCheckAuthentication()  {
        //return false;
      
return true; //此处直接设置为true有一些危险,正式使用时要适当加入自己的判断逻辑

}

至此,配置工作终于完成啦。。


在页面应用CKEditor控件

【引用压缩包内的 INSTALL.html 】

If you want to integrate CKEditor with your ASP.NET page, follow the steps outlined below.

1. Go to the official CKEditor download site and download the latest versions of both CKEditor 3.x and the CKEditor for ASP.NET Control.
2. Unpack both installation packages to a desired location.
3. Add a reference to the CKEditor for ASP.NET Control to your website.
In Visual Studio use the Add Reference command and browse to the bin\Release\CKEditor.NET.dll file from the unpacked CKEditor
for ASP.NET installation package. You can also manually copy the DLL file to the bin folder of your application.
4. Copy the unpacked editor files from the CKEditor 3.x installation package and paste them into the application directory of your website.
5. Register the CKEditor for ASP.NET Control in your page:
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
6. Insert a CKEditor instance into the page body:



http://www.cnblogs.com/gppblog/archive/2011/03/11/1981717.html
阅读(349) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~