您的位置:首页 > 编程语言 > ASP

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

2010-08-09 08:18 525 查看
1、FCKEditor官方下载地址:http://www.fckeditor.net/download
2、FCKeditor 2.6下载地址:
http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.zip
3、DLL文件下载地址:
http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125

配置方法如下:
一、在官方网站上下载解压后目录结构如下图所示:



二、删除不必要的文件
从官方下载下来的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下载FCKeditor.Net_2.6.3.zip压缩包,解压后,将FCKeditor.Net_2.6.3\bin\Debug\2.0目录下的两个文件拷贝到自己网站的bin文件夹下。



3.配置上传路径
编辑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;不过还是建议看看上面的警告
}
4、WebConfig文件的配置
[align=left]>[/align]
[align=left] "FCKeditor:BasePath" value="~/fckeditor/"/>[/align]
"FCKeditor:UserFilesPath" value="~/Upload"/>//我这里设置在了网站根目录下的Upload/FCKEditor目录中,根据实际情况和个人喜好而定。
</appSettings>
l下面的目录下2000的文件存储是在单一的一个目录进行的。我对FCKeditor以今天的日期为例:这样产生的文件上传子目录格式为:2008/10-21/add=对上传图片进行缩放处理
像素,所以我做了一个扩展,在Web.config appSettings页面:
[align=left] Page Language="C#" AutoEventWireup="true" CodeFile="fckTest.aspx.cs" Inherits="fckTest" %>[/align]
[align=left] Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>[/align]
[align=left] html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/align]
[align=left] xmlns="http://www.w3.org/1999/xhtml">[/align]
[align=left] runat="server">[/align]
[align=left]</< <form id="form1" runat="server">[/align]
[align=left] </div>[/align]
[align=left]bodyhtml① xp配置:网站->配置(G)...->添加
动作:限制为 GET,HEAD,POST,DEBUG
② [b]2003
配置:网站->配置(G)...->插入
的问题:
出现"this connector is disabled Please check
the"editor/filemanager/connectors/aspx/config.aspx"修改CheckAuthentication()、网站用到了UrlReWrite找到资源。 或者它的一个依赖项)请求的 URL: /fckEditor/editor/fckeditor.aspx[b]伪静态设置流程:

打开IIS 4.


,单击右键【属性】,6.,如图所示:

7.,
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ASP 职场 NET