在ASP中應用FCKeditor2.1.1

來源:互聯網
上載者:User

最近在項目中使用了FCKeditor的最新版,有一些問題值得注意,現在寫出來供大家參考。

1. asp頁面使用GB2312編碼。

2. 下載FCKeditor2.1.1。

3. 將FCKeditor2.1.1解壓縮到項目的根目錄下,目錄結構為:\項目名\FCKeditor\ 。

4. 修改 \項目名\FCKeditor\editor\filemanager\browser\default\connectors\asp\config.asp 和 \項目名\FCKeditor\editor\filemanager\upload\asp\config.asp 這兩個檔案,將ConfigIsEnabled變數的值均改為True,以允許上傳功能,後者用於設定快速上傳;將ConfigUserFilesPath變數的值均設為\upload\,這樣上傳檔案存到 \項目名\upload\目錄下的子目錄中。

5. 修改 \項目名\FCKeditor\editor\filemanager\browser\default\connectors\asp\connector.asp 和 \項目名\FCKeditor\editor\filemanager\upload\asp\upload.asp 這兩個檔案,將檔案中第一行<%@ CodePage=65001 Language="VBScript"%>中的 CodePage=65001 去掉,這一步非常關鍵,否則使用GB2312時會產生亂碼(感謝戰友HHH3000)。

6. 上傳的檔案不支援中文檔案名稱,要解決這個問題,可用editplus將FCKeditor所有檔案中的utf-8替換成gb2312即可,是否有副作用目前還未可知。

7. 在asp中添加如下代碼建立線上編輯器:

    在頁面的頂部加入<!--#include file="/FCKeditor/fckeditor.asp"-->

    在適當的位置加入下面代碼
    <%
     Dim oFCKeditor
     Set oFCKeditor = New FCKeditor
     'oFCKeditor.BasePath = "/FCKeditor/"    ' 設定editor目錄在項目中的位置

     oFCKeditor.ToolbarSet = "Default"
     oFCKeditor.Width = "550"
     oFCKeditor.Height = "400"

     oFCKeditor.Value = ""  ' oFCKeditor.Value = rs("content") 修改內容
     oFCKeditor.Create "content"
    %>

8. 經過上面步驟就可以在asp中使用FCKeditor了,關於FCKeditor的更多設定可參見下面的文章:

    FCKeditor 2.0線上編輯器的設定與修改以及使用

    FCKeditor2.0線上編輯器的修改與設定-檔案上傳部分管理部分

隨後將帶來在JSP中應用FCKeditor。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.