Hello!
CKEditor Version: 3.6.2
I'm testing the CKEditor at the moment and in Visual Studio 2010 (ASP.NET 4.0), my web-application works so far, but when I publish my application and create a web-application in the IIS-Server, then I get two errors, when I call the CKEditor.
I get the same error 2 times: 'CKEDITOR' is undefined
Here is my Code of ASPX-Page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Editor.aspx.cs" Inherits="MyApplication.Web.Editor" %> <%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="~/ckeditor/adapters/jquery.js"></script> <script type="text/javascript"> window.onload = function () { function getUrlParam(paramName) { paramName = paramName.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + paramName + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null)return ""; else return results[1]; } var folderID = getUrlParam('FolderID'); var index = document.URL.indexOf("Editor.aspx"); var sPath = document.URL.substring(0, index); CKEDITOR.replace('editor1', { filebrowserImageUploadUrl: sPath + 'UploadImage.ashx?FolderID=' + folderID, filebrowserFlashUploadUrl: sPath + 'UploadImage.ashx?FolderID=' + folderID, toolbar: [ { name: 'document', items: ['NewPage', 'DocProps', 'Preview', 'Print', '-', 'Templates'] }, { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] }, { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] }, { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] }, '/', { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] }, { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] }, { name: 'links', items: ['Link', 'Unlink', 'Anchor'] }, { name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak', 'Iframe'] }, '/', { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] }, { name: 'colors', items: ['TextColor', 'BGColor'] }, { name: 'tools', items: ['ShowBlocks'] } ] }); CKEDITOR.on('instanceReady', function (sender) { CKEDITOR.instances.editor1.execCommand('maximize'); }); }; function getEditorContent() { return CKEDITOR.instances.editor1.getData(); }; function setEditorContent(cnt) { CKEDITOR.instances.editor1.setData(cnt); }; </script> </head> <body> <form id="form1" runat="server"> <textarea id='editor1' name='editor1' rows="10" cols="20" style="height:600px;width:830px;" /> </form> </body> </html>
Re: Publishing Web-Application with CKEditor
Check this post to get some ideas on how to resolve the problem:
viewtopic.php?t=19701
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Re: Publishing Web-Application with CKEditor
I solved my problem!
The problem was the path to ckeditor folder.
With this settings I got the "CKEDITOR is undefined" error:
With this settings it works now in my published application:
Best Regards
Dougy