最近在项目中使用FCKeditor作为富文本编辑器,把使用中遇到的问题及解决办法总结下。
1)首先到http://www.fckeditor.net/download 去下载FCKeditor 2.6.4.zip和FCKeditor.NET(这个其实是asp.net控件)
2) 把FCKeditor 2.6.4.zip解压到项目的/目录或其他目录,我是放在/目录的,至于控件解压后在VS2008中的控件面板->选择项->浏览 添加FCKeditor的dll就能看见FCKeditor控件了,在需要的地方拖进去就能用。
3) 在web.conf中添加
<
add key
=
"
FCKeditor:UserFilesPath
"
value
=
"
/common/uploads
"
/>
作为图片等上传路径
4)修改fckconfig.js文件,找
var _FileBrowserLanguage
=
'
php
'
;
//
asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ' php ' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ' php ' ; // asp | aspx | cfm | lasso | perl | php | py
把php改成aspx,不然点上传框的时候会报些错误,导致无法上传。
5) 修改editor\filemanager\connectors\aspx\config.ascx文件
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![](https://www.cnblogs.com/Images/dot.gif)
//
// 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 false ; // 把这个false改成true
}
{
// 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
![](https://www.cnblogs.com/Images/dot.gif)
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
//
![](https://www.cnblogs.com/Images/dot.gif)
// user logs in your system.
return false ; // 把这个false改成true
}
不然会报this connector is disabled Please check
OK,到这里基本就能正常使用了。