最近在項目中使用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
把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
//
// 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
}
不然會報this connector is disabled Please check
OK,到這裡基本就能正常使用了。