閃光區
demo當選微軟2009年度第三季最有價值專家
demo獲得藍色小舖2009高級專家認證
demo獲得藍色小舖2009資訊專家貢獻獎
認證徽章
工商時間
 
demo小鋪

FCKeditor 超強html線上編輯器應用於ASP.NET

當我們在開發討論區或是留言板等應用時,常常需要編輯html的標籤,這玩意自己寫當然是可以,可是耗時費力網路上有一流傳已經很久的編輯器FCKeditor它能夠提供我們良好的使用介面,最近這一版還應用了AJAX技術讓使用上更順手,如果你有這方面的需求真的是不要錯過啦。
  • 檔案名稱:FCKeditor
  • 官方網站http://www.fckeditor.net/
  • 開發公司:sourceforge.net
  • 檔案大小:個人使用免費

在開始之前您可以做

  1. 觀看FCKeditor到底能幹啥線上預覽
  2. 下載主程式下載FCKeditor 2.6
  3. 下載.NET專用擴充下載FCKeditor.Net_2.5


主程式抓下來後就把它解壓縮放到網站目錄去



然後再把下載回來的.NET專案打開把編譯好的dll複製出來用

E:\FCKeditor.Net_2.5\bin\Release\2.0

然後把它貼到Bin的資料夾內



接者把它拉到工具列上

★注意事項:這裡有兩個是因為版本不同的關係@@


開啟fck目錄下的fckconfig.js檔案往下拉找到

var _FileBrowserLanguage    = 'asp' ;    // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage    = 'asp' ;    // asp | aspx | cfm | lasso | perl | php | py 

把它改成

var _FileBrowserLanguage    = 'aspx' ;    // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage    = 'aspx' ;    // asp | aspx | cfm | lasso | perl | php | py 

 找到

  1. FCKConfig.AdditionalNumericEntities = " ;// Single Quote: "'" 

 改成

  1. FCKConfig.AdditionalNumericEntities = "'|>|<|\\+" ;// Single Quote: "'" 


開啟一個頁面把FCKeditor拖曳出來,再把BasePath改成~/FCKeditor/預覽一下就可以使用了

  1. <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/fckeditor/">  
  2. </FCKeditorV2:FCKeditor> 


♥小提醒:用~/FCKeditor的原因是demo把它放在跟目錄下,如果您有變動請自行修改


★注意事項:只要跑的出來你會發現一切功能都正常,就是【上傳】的部份掛了=.=那是因為我還沒發功阿還沒調整到那裡,修改方式很簡單,找到以下檔案(綠色部份請自行修改)

X:\Web專案\WebSite1\fckeditor\editor\filemanager\connectors\aspx\config.ascx


找到UserFilesAbsolutePath = ""; 把它改成您要的目錄即可
(本範例丟在網站根目錄的NewFolder1目錄)

UserFilesPath = "~/NewFolder1";

如果你懶得找config.ascx檔案也可以直接在web.config檔案中相關位置加入下方code

<appsettings>  
    <add key="FCKeditor:UserFilesPath" value="~/NewFolder1" />  
</appsettings>  

然後修改config.ascx下方的內的false改成

return (Session["IsAuthorized"] != null && (bool)Session["IsAuthorized"] == true);
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 (Session["IsAuthorized"] != null && (bool)Session["IsAuthorized"] == true);
}




  ?小鋪廢言:到這樣就完成了但是如果線上使用還是有一點小疑慮,您可以參考小鋪的其他文章來作修改


當然如果你要使用的話請務必觀看授權規章唷http://www.fckeditor.net/license

 
 
加入此網頁到:Google Bookmarks
加入此網頁到:Yahoo! My Web
加入此網頁到:Baidu
加入此網頁到:MyShare
加入此網頁到:udn
加入此網頁到:furl
加入此網頁到:Del.icio.us
加入此網頁到:YouPush
加入此網頁到:Digg
加入此網頁到:你推我報
加入此網頁到:technorati
加入此網頁到:HemiDemi
 
相關的文章(隨機)

將本文推到 Plurk
將本文推到 Facebook
將本文推到 Twitter
將本文產生 PDF 保存
 

網友留言

吉子
發表於:2009-10-02
我把bin加入後但還是一樣沒有fck的工具

加入以後在拉到工具列


怪怪
發表於:2009-09-01
接者把它拉到工具列上

我到這個怪怪的耶 畫面都不一樣
會變成文字檔圖 然後出現 file:///C:\Inetpub\wwwroot\mail\Bin\FredCK.FCKeditorV2.dll

我該如何做呢 所有步驟都做了..

不是拉上去吧,是放到BIN裡面

新增評論
* 暱稱
E-mail (本站使用Gravatar頭像E-mail不會顯示於網站上)
不填寫email將不會收到回覆通知。
網站
* 評論
不打勾才可留言
demo小鋪
 .