FCKeditor如何升级CKEditor及使用方法
之前编辑器用的是FCKeditor,因为项目原因需要升级为最新版本4.2.2,发现是已经更名为CKEditor。
百度了一下,据官方的解释,CK是对FCK的代码的完全重写。
项目环境是asp.net的,之前用的FCKeditor版本是2.6。
在aspx文件头需要引用FCK的名为FredCK.FCKeditorV2.dll文件。
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
使用控件如下写法:
<FCKeditorV2:FCKeditor ID="fckContent" runat="server" Width="100%" BasePath="~/editor/" />
在.cs文件里要取得该控件值:fckContent.Value
升级为CKEditor后,有2种方法使用
第一种:去CKEditor官网找到下载CKEditor for ASP.NET ,目前版本是3.6.4。
解压压缩包,找到CKEditor.NET.dll,放到项目的bin目录下
aspx文件头引用写上:
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
使用控件:
<CKEditor:CKEditorControl runat ="server" ID="ckContent" BasePath="~/editor/"></CKEditor:CKEditorControl>
.cs文件里取得该控件值:ckContent.Text
其中的BasePath是CKEditor的包文件所在目录。(本人亲测:包文件版本放的4.2.2也是可以使用的。)
第二种:aspx文件里head里直接引用js文件:
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
body里写上如下即可(下面的script一定要在控件之下,放在head里不管用)
<asp:TextBox name="ckContent" id="ckContent" runat="server" TextMode="MultiLine" Width="300px" Height="60px" CssClass="input"/> <script type="text/javascript"> CKEDITOR.replace( 'ckContent');
</script>
升级全部完工。
另外附上项目中的如何在CKEditor里插入外部图片写法:
function OpenDialogPageForckEdit()
{
var uri = '';
var param = '';
var oEditor = CKEDITOR.instances.ckContent;
uri = 'V5Mall_Picture_Dailog.aspx?isfck=1&d=' + Date();
if (navigator.appVersion.indexOf("MSIE") == -1)
{
this.returnAction = function(strResult)
{
if(strResult != null)
{
oEditor.insertHtml(GetValue); }
}
param = 'alwaysRasied=yes,modal=yes,width=620,height=800,top=100,left=200,resizable=no,scrollbars=no';
var GetValue=window.showModalDialog(uri, '_blank', param);
oEditor.insertHtml("<img src='" + GetValue + "'>");
return;
}
else
{
//param = 'dialogWidth:550px;dialogHeight:550px;';
param = 'alwaysRasied=yes,modal=yes,width=620,height=800,top=100,left=200,resizable=no,scrollbars=no';
var GetValue = window.showModalDialog(uri, '_blank', param);
if (GetValue != null)
{
oEditor.InsertHtml("<img src='" + GetValue + "'>");
}
}
}
FCKeditor如何升级CKEditor及使用方法的更多相关文章
- CKEditor的使用方法
CKEditor的使用方法 2014-03-31 09:44 8649人阅读 评论(1) 收藏 举报 版权声明:本文为博主原创文章,未经博主允许不得转载. ckeditor 的官方网站是 http:/ ...
- Jsp页面中使用fckeditor控件的两种方法 [转]
fckeditor控件请到官方网站下载http://www.fckeditor.net,本例主要用到FCKeditor_2.6.3.zip.fckeditor-java-demo-2.4.1.zip. ...
- CKEditor使用配置方法
一.使用方法: 1.在页面<head>中引入ckeditor核心文件ckeditor.js <script type="text/javascript" src= ...
- Centos内核升级的三种方法
本文出自 “存储之厨” 博客,请务必保留此出处http://xiamachao.blog.51cto.com/10580956/1755354 在基于CentOS平台的工作过程中,难免有时需要升级或者 ...
- Eclipse 插件安装、升级和卸载的方法
Eclipse 的插件可以装在内部,也可以装在外部,装在内部的方法很简单:把插件的features和plugins目录copy到eclipse的安装目录即可. eclipse和其插件升级比较频繁,用过 ...
- 使用yum更新时不升级Linux内核的方法
RedHat/CentOS/Fedora使用 yum update 更新时,默认会 升级内核 .但有些服务器硬件(特别是组装的机器)在升级内核后,新的内核可能会认不出某些硬件,要重新安装驱动,很麻烦. ...
- nodejs升级的两种方法
方法一: 用n升级nodejs # 全局安装n$ npm install -g n# 升级到最新稳定版$ n stable # 升级到最新版$ n latest# 升级到定制版$ n v7.10.0# ...
- LuManager升级php5.6.27方法
LuManager自带的PHP在FastCGI模式是 5.2.17版,非FastCGI模式是 5.3.14版.由于360网盘的停服,已不敢再用那些免费的网盘,干脆自己搭个私有云.查了下相关资料准备先试 ...
- FCKEditor编辑器添加中文字体的方法
默认情况下,FCKEditor在进行文本编辑时,无法使用中文字体.让其添加中文字体的方法: 1.打开 fckconfig.js 文件,找到第154行(大概),会发现: 程序代码: FCKConfig. ...
随机推荐
- Java SSM框架之MyBatis3(四)MyBatis之一对一、一对多、多对多
项目搭建Springboot 1.5 pom.xml <?xml version="1.0" encoding="UTF-8"?> <pro ...
- CentOS配置源
一.源列表 aliyun源 #各系统版本repo文件对应的下载操作 CentOS wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.al ...
- Nginx报错:upstream timed out (110: Connection timed out)和client intended to send too large body【转】
nginx日志报错 2018/01/26 16:36:49 [error] 23327#0: *54953 upstream timed out (110: Connection timed out) ...
- Parameters.Add和Parameters.AddWithValue
因为vs2013没有更新update 5所以Parameters.Add可以用Parameters.AddWithValue赋值无效 更新后可以. Parameters.AddWithValue的底层 ...
- Python学习五|集合、布尔、字符串的一些特点
#集合本身就像无值的字典 list1 = set([1,2,3,4]) list2 = {1,2,3,4} print('list1 == list2?:',list1==list2)#list1 = ...
- WCF服务安全控制之netTcpBinding的用户名密码验证【转】
选择netTcpBinding WCF的绑定方式比较多,常用的大体有四种: wsHttpBinding basicHttpBinding netTcpBinding wsDualHttpBinding ...
- webapck编译打包stylus文件
先安装css-loader.stylus.stylus-loader npm install --save-dev css-loader npm install --save-dev stylus n ...
- LOJ 10160 - 「一本通 5.2 练习 3」周年纪念晚会 / 没有上司的晚会
题面 传送门 Ural 州立大学的校长正在筹备学校的 8080 周年纪念聚会.由于学校的职员有不同的职务级别,可以构成一棵以校长为根的人事关系树.每个资源都有一个唯一的整数编号,从 $1$ 到 $N$ ...
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)(转)
前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...
- Java编程的逻辑 (68) - 线程的基本协作机制 (下)
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...