惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

PCI Perspectives
PCI Perspectives
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
NISL@THU
NISL@THU
H
Help Net Security
G
Google Developers Blog
S
Securelist
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
T
Tenable Blog
M
MIT News - Artificial intelligence
罗磊的独立博客
WordPress大学
WordPress大学
I
Intezer
V2EX - 技术
V2EX - 技术
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Secure Thoughts
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Announcements
Recent Announcements
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
宝玉的分享
宝玉的分享
腾讯CDC
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
美团技术团队
H
Heimdal Security Blog
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
博客园 - 司徒正美
博客园 - Franky
W
WeLiveSecurity

博客园 - 虚空境界

当WEB站点应用程序池标识为ApplicationPoolIdentity,出现运行错误时的解决方法 sql表设计器的几个默认值 easyui中tree型控件不正常显示的处理方法 Ajax.ActionLink与Ajax.BeginForm使用场所的思考 mvc中ajax.beginform一次提交重复Post两次的问题解决 JQuery EasyUI弹出对话框解决Asp.net服务器控件无法执行后台代码的方法(转) ASP.NET验证控件RegularExpressionValidator的常见表达式 后台动态设置前台标签内容和属性(转自http://www.wzsky.net/html/Program/net/26171.html) ASP.NET中使用 Response.Write("<script>alert('****');</script>");后CSS界面发生变化的解决方法 (经验证) silverlight控件如何自适应 “System.ServiceModel.DomainServices.Client.DomainOperationException:查询"XXX"load操作失败,远程服务器返回了错误:NoFound.……”解决方法 按规定长度显示指定绑定字段的内容 asp.net中使用ckfinder2选择图片并返回图片文件的路径的代码 CKEditor3.6.1+CKFinder2.0.2结合 打造"帅"的编辑器 For .Net WEB.CONFIG资料收集 用户体验的网站首页设计的准则 开发播放器中所学/用到的知识 关于使用IDE制作样式表后不能正常显示的问题 域用户组策略禁用QQ等软件 域用户组策略设定IE主页
ckeeditor和ckfinder在asp.net中的使用
虚空境界 · 2011-05-18 · via 博客园 - 虚空境界
 

一、官方Download

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

下载的文件:ckeditor_aspnet_3.5.3.zip

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

下载的文件:ckfinder_aspnet_2.0.2.1.zip

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

二、具体配置顺序

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

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

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

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

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

3、修改配置文件

1CKEditor配置:打开“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';

}

3CKFinder的配置:

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

BaseUrl = "~/upfiles/"; //前提条件是根目录上必需存在用来存放上传文件的upfiles文件夹。

并且更改:

public override boolCheckAuthentication()  {
        //return false;
      
return true; 

}

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

三、在页面应用CKEditor控件

1、在页面中注册CKEditor控件:

    <%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

此代码写在<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>的后面。

2、然后,在<body>中需要放置该控件的位置加入CKEditor的实例:

<CKEditor:CKEditorControl ID="CKEditor1" runat="server"></CKEditor:CKEditorControl>

3、程序中使用this.CKEditor1.Text获取CKEditor控件的内容

四、运行程序即可