Nir*_*man 15 iis asp.net-mvc bundle ckeditor asp.net-mvc-4
我在我的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")
Run Code Online (Sandbox Code Playgroud)
"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'] }
];
};
Run Code Online (Sandbox Code Playgroud)
以下是我如何显示textarea的CKEditor:
$("#idBodyText").ckeditor();
Run Code Online (Sandbox Code Playgroud)
问题是,它在本地工作正常,如果在调试模式下在本地IIS上运行.但是,在具有发布配置的IIS上部署时,它不会显示CKEditor.
知道可能的原因是什么,以及如何解决这个问题?
任何帮助都非常感谢.
谢谢
Nir*_*man 34
作为一个决议,事实证明,在加载捆绑包之前,我必须在我的视图中包含以下行 -
<script type="text/javascript">
CKEDITOR_BASEPATH = "@Url.Content("~/Scripts/ckeditor/")";
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5435 次 |
| 最近记录: |