2012-05-31 61 views
1

我的ckeditor的工作很好,除了瀏覽服務器和其他功能。CkFinder與Ckeditor的集成在我的Asp.net mvc3中失敗。我可以如何成功集成它?

在CKEditor的

CKEDITOR.editorConfig = function (config) { 
    config.htmlEncodeOutput = true, 
    config.filebrowserBrowseUrl = true, 
    config.filebrowserImageBrowseUrl=true 
    }; 

    var editor = CKEDITOR.replace("profiel_lange_beschrijving", { toolbar: 'Full' }); 
    CKFinder.setupCKEditor(editor, '~/Scripts/ckfinder'); 
    CKEDITOR.replace('editor', 
    { 
    filebrowserBrowseUrl: '~/Scripts/ckfinder/ckfinder.html', 
    filebrowserImageBrowseUrl: '~/Scripts/ckfinder/ckfinder.html?type=Images', 

    filebrowserUploadUrl: '~/Scripts/ckfinder/core/connector/aspx/connector.aspx? command=QuickUpload&type=Files', 
    filebrowserImageUploadUrl: '~/Scripts/ckfinder/core/connector/aspx/connector.aspx? command=QuickUpload&type=Images' 
    command=QuickUpload&type=Flash' 
}); 

我怎麼能成功整合的CKEditor的ckfinder配置文件?請幫助朋友

回答

3

整合Ckfinder在CKEditor的。那麼你的Razor視圖

CKEDITOR.replace('editor', 
{ 
filebrowserImageBrowseUrl: '/Scripts/ckfinder/ckfinder.html?type=UploadedImages', 
filebrowserUploadUrl: '/Scripts/ckfinder/core/connector/aspx/connector.aspx?  command=QuickUpload&type=Files', 
filebrowserImageUploadUrl:'/UploadImage/Upload' 

} 
); 

其中 '編輯' 是文本框的ID添加此。

然後創建一個UploadImage控制器

public ActionResult Upload(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode) 
    { 
     string url; // url to return 
     string message; // message to display (optional) 
     message = "Image successfully saved "; 

    //do save image code here 
     url = "/" + path + "/" + filename; 
     string output = @"<html><body><script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + url + "\", \"" + message + "\");</script></body></html>"; 

      return Content(output); 
     } 

試試這個它的偉大工程

1

你可能會過度複雜的東西。這裏是CKFinder installation guide的鏈接,以及指向configuration guide的鏈接,兩者均適用於CKFinder的ASP.NET版本。

+0

喜有整合ckfinder到CKEDITOR –

+0

它shiowing解析器error.how我可以整合它的Razor視圖沒有適當的文件?/ –

+0

以下是集成指南[鏈接](http://docs.cksource.com/CKFinder_2.x/Developers_Guide/ASP.NET/Integration)。至於解析器問題,請嘗試在我們的論壇[鏈接](http://cksource.com/forums/)中發佈問題。 –