---
title: "有关FCKeditor在asp.net 2.0下的配置问题."
author: "cetusz"
date: "2009-08-03T16:34:00Z"
tags: []
slug: "fckeditor-asp-net-2-0"
draft: false
lastmod: "2009-08-03T16:34:00Z"
id: 787141
url: "https://cetus.iteye.com/blog/787141"
---

今天配置了一下fckeditor,将这一过程与大家分享.  
fckeditor相关网址：  
官方地址：[http://www.fckeditor.net/](http://www.fckeditor.net/)  
下载地址：[http://www.fckeditor.net/download/default.html](http://www.fckeditor.net/download/default.html)  
演示地址：[http://www.fckeditor.net/demo/default.html](http://www.fckeditor.net/demo/default.html)  
　首先下载FCKeditor V2.4.3，下载地址：[http://sourceforge.net/project/showfiles.php?group\_id=75348&package\_id=75845](http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=75845)；这个压缩包里并不包含ASP.NET要用到的DLL控件，所以还要下载另外一个压缩包，下载地址：[http://sourceforge.net/project/showfiles.php?group\_id=75348&package\_id=137125](http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125)。把第一个文件解压到WEB根目录，默认文件夹名为：FCKeditor；再把第二个包解压，里面包含了源代码，如果你想自己再次开发，可以双击FredCK.FCKeditorV2.csproj文件，打开VS.NET进行修改，所用的语言是C#；不想修改的话，直接把bin\\Release下面的FredCK.FCKeditorV2.DLL文件拷到WEB目录的bin下面。  
  到这一步，已经可以用了，但是上传图片会出错.我下载的这个版本的 默认上传的页面时php写的，所以需要修改config.js这个文件  
修改如下：  
       打开fckeditor/fckconfig.js    
  找到中间的：    
  var   \_FileBrowserLanguage   =   'aspx'   ;   //   asp   |   aspx   |   cfm   |   lasso   |   perl   |   php   |   py    
  var   \_QuickUploadLanguage   =   'aspx'   ;   //   asp   |   aspx   |   cfm   |   lasso   |   php    
   但 到这一步 还是不行 提示”this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx“这样的错误  
解决方法：

打开editor/filemanager/connectors/aspx/config.ascx修改CheckAuthentication()方法，返回true

C# code

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;  
}

到这里 就可以正常使用这个功能强大的编辑器了.呵呵~  
有兴趣的可以再看看这篇文章 [http://dsclub.cnblogs.com/archive/2006/05/06/392337.html](http://dsclub.cnblogs.com/archive/2006/05/06/392337.html)