FCKeditor文本编辑器的使用方法

 

FCKeditor是一个功能强大支持所见即所得功能的文本编辑器,可以为用户提供微软office软件一样的在线文档编辑服务。

它不需要安装任何形式的客户端,兼容绝大多数主流浏览器,支持ASP.Net、ASP、ColdFusion 、PHP、Jsp、Active-FoxPro、Lasso、Perl、ython 等编程环境。

官方网站 http://www.fckeditor.net/

官方文档 http://wiki.fckeditor.net/

下载地址 http://www.fckeditor.net/download/default.html

FCKeditor安装和配置

下载FCKeditor2.63.zip和FCKeditor.NET2.63版的2个zip包

(a)   FCKeditor_2.6.3是html文件、Javascript文件和图片等资源文件

(b)   FCKeditor.Net_2.6.3.zip是一个ASP.NET控件DLL文件 

Asp.Net项目中添加对 FCKeditor 的引用

1. 项目上选择添加引用找到FredCK.FCKeditorV2.dll或直接将FredCK.FCKeditorV2.dll复制到项目的Bin目录中

2. 为了方便开发,可以把FredCK.FCKeditorV2.dll控件也添加到VS的工具箱中

3. 配置Web.Config,在<appSettings>节点添加,如下所示:

<appSettings>

<!--FCKeditor文本编辑控件配置-->

<add key="FCKeditor.BasePath" value="~/FCKeditor/"/>

<add key="FCKeditor.UserFilesPath" value="/解决方案名/uploads"/> //UserFilesPath的文路径可以在FCKeditor/editor/filemanager/connectors/aspx/config.ascx中更改

 
</appSettings>
4.网页中使用
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<body>
  <FCKeditorV2:FCKeditor ID="FCKeditor" runat="server" BasePath="~/FCKeditor/">//BasePath指定到FCKeditor的根目录  </FCKeditorV2:FCKeditor>
</body>
 

FCKeditor 的配置:

进入FCKeditor文件夹,编辑 fckconfig.js 文件

1、修改(改成自己当前使用的语言)

 

var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py

var _QuickUploadLanguage = 'aspx' ;// asp | aspx | cfm | lasso | perl | php | py

2、修改配置语言

FCKConfig.DefaultLanguage = ‘en’  为: FCKConfig.DefaultLanguage = ‘zh-CN’ ;

3、配置皮肤,有default、office2003、silver风格等。

FCKConfig.SkinPath = FCKConfig.BasePath + ’skins/default/’ ;

4、在编辑器域内可以使用Tab键。(1为是,0为否)

FCKConfig.TabSpaces = 0 ; 改为 FCKConfig.TabSpaces = 1 ;

5、加上几种常用的字体:

 FCKConfig.FontNames = ‘宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana’;

6、编辑器域内默认的显示字体为12px,想要修改可以通过修改样式表来达到要求,打开/editor/css/fck_editorarea.css,修改font-size属性即可

7、关于安全性

如果你的编辑器用在前台非认证的情况下,推荐使用Basic的toolbar

FCKConfig.ToolbarSets["Basic"] = [
  ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','Image','-','About']

] ;

8、在上传文件窗口点击浏览服务器,可能会出现 the server didn’t send back a proper xml….. 错误提示,是因为FCKeditor要求不同类型的文件分别传到不同的目录,包括file,image,falsh,media 等目录,可以先建立起来试试。

FCKEditor.NET 2.6 的安全性配置

文件上传,出错:(This connector is disabled.please check the "editor/filemanager/connectors/aspx/config.ascx" file.)

打开 editor/filemanager/connectors/aspx/config.ascx 文件,返回true.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值