1.裁剪(ckeditor在\_Samples\ckeditor中)
2.添加引用:CKEditor.NET.dll、CKFinder.dll
3.配置CKEditor:
ckeditor/config.js
CKEDITOR.editorConfig = function (config) {
config.skin = 'office2003';
};
4.使用CKEditor:
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<CKEditor:CKEditorControl ID="txtInfo" runat="server" Height="200" Width="700" BasePath="../Controls/ckeditor" ResizeEnabled="false"></CKEditor:CKEditorControl>
5.配置CKFinder:
ckfinder/config.ascx
public override bool CheckAuthentication()
{
return true;//或者使用用户登陆判断
}
public override void SetConfig()
{
……
BaseUrl = "~/userfiles/";
……
}
6.使用CKFinder:
在Page_Load中
if (!IsPostBack)
{
CKFinder.FileBrowser fileBrowser = new CKFinder.FileBrowser();
fileBrowser.BasePath = "../Controls/ckfinder/";
fileBrowser.SetupCKEditor(txtInfo);
}