你還在使用2.X嗎?CKEditor 3.6介面效果很漂亮,功能強大,配置也簡單,下面我來介紹一下配置方法:
1.首先到http://ckeditor.com/download官方網站下載最新的CKEditor ,目前的最新版是3.61,下載 CKEditor for ASP.NET。下載完成後,解壓壓縮包,可以看到提供的例子和bin目錄,還有_Samples檔案夾。
2.開啟你的項目,把_Samples檔案夾下的ckeditor檔案夾copy到你的項目裡面,然後添加引用,尋找到 bin目錄下的Release檔案夾下的CKEditor.NET.dll,添加引用。
3.在設定檔中添加
<system.web>
<pages>
<controls>
<add tagPrefix="CKEditor" assembly="CKEditor.NET" namespace="CKEditor.NET"/>
</controls>
</pages>
</system.web>
3.在應用到ckeditor的頁面引入
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
4.在需要用到ckeditor的地方加入
<CKEditor:CKEditorControl ID="CKEditor1" runat="server"></CKEditor:CKEditorControl>
改變顏色:
<CKEditor:CKEditorControl ID="dataContent" runat="server" UIColor="#4e72b8" Language="de" EnterMode="BR">
</CKEditor:CKEditorControl>
修改 UIColor的顏色代碼值就可以自訂控制項的顏色,效果很好看!
If you want use the CKEditor for ASP.NET Control, you must add references to the project and register the control.
If you only intend to use the control on a single page, you can add a Register section to its source code:
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
If you intend to use the control on multiple pages, you can add the Register section in web.config. Insert the following code into the <system.web><pages><controls> section:
<add tagPrefix="CKEditor" assembly="CKEditor.NET" namespace="CKEditor.NET"/>
To insert the CKEditor for ASP.NET Control into a web page, use the following code:
<CKEditor:CKEditorControl ID="CKEditor1" runat="server"></CKEditor:CKEditorControl>