I started working on CKEditor and CKFinder since a day. I would need your expertise in fixing the issue I am facing. Scenario: I need to integrate CKEditor 4.0 with CKFinder. CKEditor should be set to some text in code behind file(.aspx.cs)
Steps I took so far, Installed CKEditor and CKFinder into ckeditor and ckfinder folders respectively in my root directory.
Version 1:
<textarea id="editor1" name="editor1"></textarea>
<script type="text/javascript">
var editor = CKEDITOR.replace('editor1',{ toolbar: 'Basic' });
CKFinder.setupCKEditor(editor, '/ckfinder/');
</script>
Problem with this approach: As you might have noticed, is not a server side control. How do I access it in my code behind file? I could do
CKEDITOR.instances.editor1.setData("This is my static text");
in the script tag but I get my hands on the data that I need to be set only in code behind page. How do I pass that value from code behind to my .aspx page and set that using the setData()?
Version 2:
<textarea class = "ckeditor" id="editor1" name="editor1" runat = "server"></textarea>
<script>
var edt = CKEDITOR.replace('editor1', { toolbar: 'Basic' });
CKFinder.setupCKEditor(edt, '/ckfinder/');
</script>
AS the is a server side control, i could access it in code behind and set its value something like editor1.value = note.text; Problem with this approach, ckfinder is not integrated into ckeditor's image or link buttons. Upon checking in mozilla firebug,
var edt = CKEDITOR.replace('editor1', { toolbar: 'Basic' });
gives me an error, TypeError: b is undefined [Break On This Error]
...';var m=new CKEDITOR.editor(e,b,h);h==CKEDITOR.ELEMENT_MODE_REPLACE&&b.setStyle(...
Please tell me which Version is the better one to use and how I could override the respective issue with that particular Version.