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

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 虚空境界

当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控件的内容

四、运行程序即可