close

官方網站  http://ckeditor.com

官方下載網址 http://ckeditor.com/download

使用FCKeditor作為ASP.NET控制項必須下載2個檔案

FCKeditor    樣版

Our previous editor solution, stable and full featured

FCKeditor 2.6.6, released on 15 February 2010

FCKeditor    元件

FCKeditor.Net: ASP.Net Control to easily integrate FCKeditor on ASP.NET pages

FCKeditor.Net 2.6.3, released on 26 July 2008

Attention: The main code is not included in this package, just the ASP.Net Control. You still need the FCKeditor scripts to be able to run it, so download it too.

 

1.解開壓縮 FCKeditor.Net_2.6.3.zip
2.將 FCKeditor.Net 2.6.3\FCKeditor.Net_2.6.3\bin\Debug\2.0 中的 FredCK.FCKeditorV2.dll 放入專案的BIN中
3.解開壓縮 FCKeditor_2.6.6.zip
4.將 FCKeditor.Net 2.6.3\FCKeditor_2.6.6 中的fckeditor 資料夾放到網站根目錄中

設定

FCKeditor加到控制項

1.開啟 Microsoft Visual Studio

2.到.NET環境下的 工具 > 選擇工具箱項目...>瀏覽>選擇

a0001.JPG a0002.jpg a0003.jpg

設定web.config

   <appSettings>
  <add key="FCKeditor:BasePath" value="~/FCKeditor/"/>
  <add key="FCKeditor:UserFilesPath" value="~/uploadfile/"/>
 </appSettings>

"FCKeditor:BasePath" value="~/FCKeditor/" 是設定fckeditor程式檔所在的目錄

"FCKeditor:UserFilesPath" value="~/uploadfile/"是設定fckeditor上檔檔案的目錄

  

設定fckconfig.js

設定控制上傳檔案及圖片所用程式語言

 

搜尋

var _FileBrowserLanguage = 'php' ;

var _QuickUploadLanguage = 'php' ;

把'php'改成'aspx',如下:

var _FileBrowserLanguage = 'aspx'' ;

var _QuickUploadLanguage ='aspx'' ;

安全權限設定

 

增加檔案上傳的安全性

FCKeditor在檔案上傳做了簡單的安全設定,

根據上一個步驟所設定的語言是aspx,因此要到對應的資料夾下去設定該檔案,aspx的安全設定檔在

\fckeditor\editor\filemanager\connectors\aspx\config.ascx

private bool CheckAuthentication() 中

安全設定上可分為3種設定方式:1.簡易設定,2.安全設定,3拒絕上傳

1.簡易上傳:任何登入網站的使用者都可以使用FCKeditor的上傳功能    return true ;

2.安全設定:經過網站身份認證,才可上傳檔案(Session[ "IsAuthorized"]=true)

3.拒絕上傳:任何人都無法上傳檔案

  

配置語言

FCKConfig.DefaultLanguage = ‘en’ ;

外框樣版

FCKConfig.SkinPath = FCKConfig.BasePath + ’skins/default/’ ; 可設成 silver  office2003  default

 

 

[超連結]>[上傳]無法上傳問題

FCKConfig.LinkBrowseURL改成

FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=File&Connector=' + encodeURIComponent

( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ;

2.找到FCKConfig.LinkUploadURL改成

FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension+'?Type=File' ;

 

配置選項:

AutoDetectLanguage=true/false 自動檢測語言
BaseHref="" 相對鏈接的基地址
ContentLangDirection="ltr/rtl" 默認文字方向
ContextMenu=字符串數組,右鍵菜單的內容
CustomConfigurationsPath="" 自定義配置文件路徑和名稱
Debug=true/false 是否開啟調試功能,這樣,當調用FCKDebug.Output()時,會在調試窗中輸出內容
DefaultLanguage="" 缺省語言
EditorAreaCss="" 編輯區的樣式表文件
EnableSourceXHTML=true/false 為TRUE時,當由可視化界面切換到代碼頁時,把HTML處理成XHTML
EnableXHTML=true/false 是否允許使用XHTML取代HTML
FillEmptyBlocks=true/false 使用這個功能,可以將空的塊級元素用空格來替代
FontColors="" 設置顯示顏色拾取器時文字顏色列表
FontFormats="" 設置顯示在文字格式列表中的命名
FontNames="" 字體列表中的字體名
FontSizes="" 字體大小中的字號列表
ForcePasteAsPlainText=true/false 強制粘貼為純文本
ForceSimpleAmpersand=true/false 是否不把&符號轉換為XML實體
FormatIndentator="" 當在源碼格式下縮進代碼使用的字符
FormatOutput=true/false 當輸出內容時是否自動格式化代碼
FormatSource=true/false 在切換到代碼視圖時是否自動格式化代碼
FullPage=true/false 是否允許編輯整個HTML文件,還是僅允許編輯BODY間的內容
GeckoUseSPAN=true/false 是否允許SPAN標記代替B,I,U標記
IeSpellDownloadUrl=""下載拼寫檢查器的網址
ImageBrowser=true/false 是否允許瀏覽服務器功能
ImageBrowserURL="" 瀏覽服務器時運行的URL
ImageBrowserWindowHeight="" 圖像瀏覽器窗口高度
ImageBrowserWindowWidth="" 圖像瀏覽器窗口寬度
LinkBrowser=true/false 是否允許在插入鏈接時瀏覽服務器
LinkBrowserURL="" 插入鏈接時瀏覽服務器的URL
LinkBrowserWindowHeight=""鏈接目標瀏覽器窗口高度
LinkBrowserWindowWidth=""鏈接目標瀏覽器窗口寬度
Plugins=object 註冊插件
PluginsPath="" 插件文件夾
ShowBorders=true/false 合併邊框
SkinPath="" 皮膚文件夾位置
SmileyColumns=12 圖符窗列數
SmileyImages=字符數組 圖符窗中圖片文件名數組
SmileyPath="" 圖符文件夾路徑
SmileyWindowHeight 圖符窗口高度
SmileyWindowWidth 圖符窗口寬度
SpellChecker="ieSpell/Spellerpages" 設置拼寫檢查器
StartupFocus=true/false 開啟時FOCUS到編輯器
StylesXmlPath="" 設置定義CSS樣式列表的XML文件的位置
TabSpaces=4 TAB鍵產生的空格字符數
ToolBarCanCollapse=true/false 是否允許展開/折疊工具欄
ToolbarSets=object 允許使用TOOLBAR集合
ToolbarStartExpanded=true/false 開啟是TOOLBAR是否展開
UseBROnCarriageReturn=true/false 當回車時是產生BR標記還是P或者DIV標記

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 meltdown 的頭像
    meltdown

    meltdown

    meltdown 發表在 痞客邦 留言(0) 人氣()