服務(wù)熱線
153 8323 9821
摘要:FCKeditor是一款功能強(qiáng)大的開源在線文本編輯器,使你在web上可以使用類似微軟Word的桌面文本編輯器的許多強(qiáng)大功能。本文以FCKeditor2.6.3介紹在asp.Net中的配置方法。
難度:10
FCKeditor是一款功能強(qiáng)大的開源在線文本編輯器(DHTML editor),使你在web上可以使用類似微軟Word 的桌面文本編輯器的許多強(qiáng)大功能。FCKeditor目前的最新版本是2.6.3,本文以FCKeditor2.6.3介紹在asp.Net中的配置方法。
FCKEditor官方下載地址:http://www.fckeditor.net/download
在官方網(wǎng)站下載
FCKeditor 2.6.3: FCKeditor_2.6.3.zip
FCKeditor.Net :FCKeditor.Net_2.6.3.zip
配置方法如下:
一、刪除不必要的文件
從官方下載下來的FCKEditor2.6.3大小有3.81M(解壓后),其實有很多文件對于只用ASP.NET的來講是不需要的,我們可以刪除不必要的文件:解壓縮FCKeditor_2.6.3.zip到vs2008對應(yīng)的項目fckeditor文件夾中,同時把文件夾內(nèi)帶_的文件夾和文件一并刪除:
1.fckeditor目錄下除editor目錄、fckconfig.js、fckeditor.js fckstyles.xml fcktemplates.xml 這幾個保留,其余的全部刪除
2.editor\filemanager\connectors目錄中除aspx目錄外全部刪除
3.editor\lang目錄中除en.js、zh.js 、zh-cn.js外全部刪除
4.刪除_samples目錄,當(dāng)然如果你想看示例,就不要刪除這個目錄了。
二、下載FCKeditor.Net_2.6.3.zip。解壓縮,將bin/Release中的FredCK.FCKeditorV2.dll拷貝到網(wǎng)站或項目的bin目錄內(nèi)。這里要注意選擇一下asp.Net的版本
三、fckconfig.js修改:
FCKConfig.DefaultLanguage = ’zh-cn’ ;
var _FileBrowserLanguage = ’aspx’ ;
var _QuickUploadLanguage = ’aspx’ ;
四、web.config相關(guān)配置:
<appSettings>
<add key="FCKeditor:BasePath" value="~/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="~/upload/"/>
<!--在2.6中配置文件配置路徑-->
</appSettings>
五、頁面調(diào)用
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" ToolbarSet="Basic"></FCKeditorV2:FCKeditor>
取值之只要 FCKeditor1.Value就可以輕松實現(xiàn)
還需注意,如果網(wǎng)站用了URLRewriter.dll來重定向,就需要在web.config的配置中加入以下代碼。
<system.web>
<!--
設(shè)置 compilation debug="true" 將調(diào)試符號插入
已編譯的頁面中。但由于這會
影響性能,因此只在開發(fā)過程中將此值
設(shè)置為 true。
-->
<compilation debug="true">
<buildProviders>
<add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
</buildProviders>
</compilation>
</system.web>