[英]CKEditor not working when site is deployed on IIS
我在我的MVC應用程序中使用CKEditor。
我正在使用“ckeditor-full”(版本4.4.2)包。
我在包中包含了“ckeditor \\ adapters \\ jquery.js”和“ckeditor \\ ckeditor.js”文件,並在_Layout.cshtml文件中引用了這些包。
@Scripts.Render("~/bundles/Scripts/ckeditor")
@Scripts.Render("~/bundles/Scripts/ckeditor/adapters")
“Scripts / ckeditor”文件夾包含隨包一起下載的所有352個文件。
以下是config.js文件(它位於“Scripts / ckeditor”文件夾中。
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
config.toolbar = 'Custom';
config.disableNativeSpellChecker = false;
config.browserContextMenuOnCtrl = true;
config.forcePasteAsPlainText = true;
config.toolbar_Custom = [
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat'] },
{ name: 'paste', items: ['PasteText'] },
{ name: 'links', items: ['Link', 'Unlink'] }
];
};
以下是我如何顯示textarea的CKEditor:
$("#idBodyText").ckeditor();
問題是,它在本地工作正常,如果在調試模式下在本地IIS上運行。 但是,在具有發布配置的IIS上部署時,它不會顯示CKEditor。
知道可能的原因是什么,以及如何解決這個問題?
任何幫助都非常感謝。
謝謝
作為一個決議,事實證明,在加載捆綁包之前,我必須在我的視圖中包含以下行 -
<script type="text/javascript">
CKEDITOR_BASEPATH = "@Url.Content("~/Scripts/ckeditor/")";
</script>
檢查您的包如何在頁面源中生成stylesheet
和scripts
鏈接:
@Scripts.Render("~/bundles/Scripts/ckeditor")
@Scripts.Render("~/bundles/Scripts/ckeditor/adapters")
這可能是HTTP Error 404 - File or Directory not found
或403.2 - Read access forbidden.
- 在這種情況下,您應該檢查文件是否正確存儲在serwer(正確的位置)並檢查該文件夾的權限。
Firebug也有助於調試。 我強烈建議使用它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.