此处将为大家介绍关于asp.netCKEditor和CKFinder的应用的详细内容,并且为您解答有关ckeditorforasp.net的相关问题,此外,我们还将为您介绍关于ASP.NET中CKEd
此处将为大家介绍关于asp.net CKEditor和CKFinder的应用的详细内容,并且为您解答有关ckeditor for asp.net的相关问题,此外,我们还将为您介绍关于ASP.NET中CKEditor与CKFinder的配置使用、ASP.NET版CKEditor与CKFinder的配置使用、ckeditor + ckfinder + oss存储、CKEditor 4.5 and CKFinder 3 beta 发布的有用信息。
本文目录一览:- asp.net CKEditor和CKFinder的应用(ckeditor for asp.net)
- ASP.NET中CKEditor与CKFinder的配置使用
- ASP.NET版CKEditor与CKFinder的配置使用
- ckeditor + ckfinder + oss存储
- CKEditor 4.5 and CKFinder 3 beta 发布
asp.net CKEditor和CKFinder的应用(ckeditor for asp.net)
CKEditor是新一代的FCKeditor,是一个重新开发的版本。CKEditor是全球最优秀的网页在线文字编辑器之一,因其惊人的性能与可扩展性而广泛的被运用于各大网站。而CKFinder是一个功能强大的ajax文件管理器。其简单的用户界面使得各类用户,不管是从高级专业人才,还是互联网初学者,都够直观、快速学习的学习使用它。网址:
CKEditor :http://ckeditor.com/
CKFinder :http://ckfinder.com/
CKEditor 的使用
准备工作
1. 下载CKEditor并将其解压到Web根目录下
2. 精简目录:
_samples文件夹(示例文件,可以删除)
_source文件夹(源程序文件,可以删除)
changes.html(更新列表,可以删除)
install.html(安装指向,可以删除)
license.html(使用许可,可以删除)
CKEditor的配置(config.js文件)
详细api参数见:http://docs.cksource.com/ckeditor_api/,我的默认配置
// 自定义 CKEditor 样式
CKEDITOR.editorConfig = function(config) {
//配置默认配置
config.language = ''zh-cn''; //配置语言
// config.uiColor = ''#FFF''; //背景颜色
// config.width = 400; //宽度
// config.height = 400; //高度
// config.skin = ''v2''; //编辑器皮肤样式
// 取消 “拖拽以改变尺寸”功能
// 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''],
// [''Image'', ''Flash'', ''Table'', ''HorizontalRule'', ''Smiley'', SpecialChar'',''PageBreak''],
// ''/'',
// [''Bold'', ''Italic'', ''Underline'', ''-'', ''Subscript'', ''Superscript''],
// [''NumberedList'', ''BulletedList'', ''-'', ''Outdent'', ''Indent'', ''Blockquote''],
// [''JustifyLeft'', ''JustifyCenter'', ''JustifyRight'', ''JustifyBlock''],
// [''Link'', ''Unlink'', ''Anchor''],
// ''/'',
// [''Format'', ''Font'', ''FontSize''],
// [''TextColor'', ''BGColor''],
// [''Maximize'', ''ShowBlocks'', ''-'', ''About'']
// ];
};
CKEditor 的应用
1. 在 aspx 页面或者 master 模板页 <head> 标签中加载 ckeditor.js:
<!-- 载入 CKEditor JS 文件 -->
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
2. 修改页面的page指令ValidateRequest="false"
<%@ Page Language="C#" ValidateRequest="false" %>
3. 在<body>标签中使用ckeditor:
<!-- 使用 ckeditor 必须定义-->
<asp:TextBox ID="txtContent"TextMode="MultiLine"
Text=''<%# Bind("info") %>'' runat="server"></asp:TextBox>
4. 获取或设置编辑器中的内容
//获取编辑器中的内容
lblView.Text=Server.HtmlEncode( this.txtContent.Text);
//设置编辑器中的内容
//txtContent.Text = Server.HtmlDecode("<h1>设置内容</h1>");
CKFinder 的使用
准备工作
1. 下载CKFinder的Asp.NET版,将其解压到Web根目录下
2. 复制/bin/Release目录下的ckfinder.dll文件至站点bin目录
3. 精简目录:
_samples文件夹(示例文件,可以删除)
_source文件夹(源程序文件,可以删除)
CKFinder的配置
1. 打开 " \ckfinder\config.ascx ",为SetConfig方法中的 BaseUrl 指定默认路径,如:
// 以userfiles 为默认路径,其目录下会自动生成images、flash等子目录。
BaseUrl = " ~/ckfinder/userfiles/";
// NOTE:注意“ ~/ ”。
2. 与CKEditor集成
打开CKEditor目录中的config.js文件在function 函数中
// 自定义 CKEditor 样式
CKEDITOR.editorConfig = function(config) {
……
};