当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > FCKeditor 2.6在ASP.NET中的配置方法

ASP.NET
FreeTextBox(版本3.1.6)在ASP.Net 2.0中使用方法
.NET 常用功能和代码小结
在 .NET Framework 2.0 中未处理的异常导致基于 ASP.NET 的应用程序意外退出
asp.net IList查询数据后格式化数据再绑定控件
asp.net sql存储过程
asp.net 简单实现禁用或启用页面中的某一类型的控件
asp.net(c#)获取内容第一张图片地址的函数
The remote procedure call failed and did not execute的解决办法
ASP.NET 在线文件管理
asp.net 读取并修改config文件实现代码
ASP.NET Cookie 操作实现
asp.net Silverlight中的模式窗体
Silverlight中动态获取Web Service地址
asp.net Silverlight应用程序中获取载体aspx页面参数
asp.net 水晶报表隔行换色实现方法
asp.net 获取Gridview隐藏列的值
手动把asp.net的类生成dll文件的方法
asp.net 使用ObjectDataSource控件在ASP.NET中实现Ajax真分页
动态指定任意类型的ObjectDataSource对象的查询参数
asp.net Md5的用法小结

FCKeditor 2.6在ASP.NET中的配置方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 58 ::
收藏到网摘: n/a

FCKEditor目前的最新版本是2.6,但支持.NET的DLL版本还是2.5,本文介绍FCKEditor2.6在ASP.NET中的配置方法。

本文的示例下载地址(包含了整个解决方案及网站,下载后即可使用):
地址:http://www.china-aspx.com/Forum/showtopic-57.aspx

FCKEditor官方下载地址:http://www.fckeditor.net/download

配置方法如下:

一、在官方网站上下载

下载地址:http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.zip

解压后目录结构如下图所示:



二、删除不必要的文件

从官方下载下来的FCKEditor2.6大小有3.61M(解压后),其实有很多文件对于只用ASP.NET的来讲是不需要的,我们可以删除不必要的文件:

1.根目录下除editor目录、fckconfig.js、fckeditor.js  fckstyles.xml  fcktemplates.xml 这几个保留,其余的全部删除

2.editor\filemanager\connectors目录中除aspx目录外全部删除

3.editor\lang目录中除en.js、zh.js 、zh-cn.js外全部删除

4.删除_samples目录,当然如果你想看示例,就不要删除这个目录了。

三、FCKEditor2.6的详细设置

1.fckconfig.js中修改

FCKConfig.ToolbarSets["Default"] = [
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About']  // No comma for the last row.
] ;
//上面一段我去掉了一些不常用的功能,可以根据实际需要增加。
FCKConfig.DefaultLanguage  = 'zh-cn' ;    //原来是en
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py  改成aspx
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py

2.在Bin中加入DLL文件
DLL文件下载地址:http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125

3.在工具栏中加入DLL文件

4.配置上传路径
编辑FCKeditor\editor\filemanager\connectors\aspx\config.aspx 中修改

private bool CheckAuthentication()
{
  // WARNING : DO NOT simply return "true". By doing so, you are allowing
  // "anyone" to upload and list the files in your server. You must implement
  // some kind of session validation here. Even something very simple as...
  //
  //  return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
  //
  // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
  // user logs in your system.
  return true; //原来这里是 false;不过还是建议看看上面的警告
}

在SetConfig方法中设置

UserFilesPath = "~/Upload/FCKEditor";//我这里设置在了网站根目录下的Upload/FCKEditor目录中,根据实际情况和个人喜好而定。

好了,大家有什么问题可以去http://www.china-aspx.com/Forum提问,也可MSN:[email protected]

本文的示例下载地址(包含了整个解决方案及网站,下载后即可使用):
地址:http://www.china-aspx.com/Forum/showtopic-57.aspx