I have been using the FCK Editor version 2+ for about a year in our Syrinx Community Server product (http://syrinx.ph/community.aspx). This is an asp.net CMS type system. We wanted to upgrade to version 3, but saw that the ASP.NET control wasnt ready, so we wrote one that would work well for us.
You can download the ASP.NET control from codeplex at http://syrinxckeditor.codeplex.com/.
The ASP.NET control is completely compatible with the ASP.NET theme structure, and is skinable. All of the major properties of the control are setup to be configured in ASP.NET skin files, which makes it much easier to do things like have different skins for editors that need different levels of toolbar support. In previous version of FCKEditor the standard was to define custom toolbars in the config file within the distribution. This made it more difficult to upgrade the editor to a newer version. Now, toolbar configurations can be defined in a theme skin, or in an external JS file.
ASP.NET ViewState is support for all properties except the Text property. This allows the controls configuration to be changed in event handlers and be remembered properly as standard ASP.NET events take place. Because very large documents can be edited in the control, it was decided to not use ViewState for the Text property to avoid the ViewState becoming too large. However, the ASP.NET control does implement the ASP.NET IPostBackDataHandler interface and uses that to get the value of the editor from the form post data and place it back in the Text property. The only loss from not using ViewState for the Text property is that the control cannot tell that the editor contents have changed during a postback and thus it does not raise a text changed event.
Our CkEditor control also inherits from ITextControl, make it plug and play with the standard ASP.NET text controls like the TextBox. This made integration into our SCS product easier, as we already had good support for the ITextControl interface.
One goal we had with the ASP.NET control is to make it really easy to inherit from the class to provide specific server side behavior beyond what comes with the base class provided here. The process of building up the configuration options and the html for the browser are all marked virtual, and were designed with inheritance in mind. In our SCS product, we have another class that inherits from this to integrate within our environment better, such as automatically switching the language used by the editor based on the user's selected culture. We also use it to resolve macros embedded in configuration options based on SCS's macro environment.
Because we are using this ASP.NET control in our production systems, we know it is solid and works well. There do seem to be some minor bugs in the way the new CKEditor works, but overall we are very happy with the move and highly recommend that if you are using an older version of FCKEditor, to make the jump up. We hope this ASP.NET control will make the job easier for you.
Thu, 09/10/2009 - 06:26
#1
Re: New ASP.NET CK Editor v3 control available!
Im gonna test it today / tomorrow!
Thnx!
Re: New ASP.NET CK Editor v3 control available!
Re: New ASP.NET CK Editor v3 control available!
Fantastic man, thanks a lot. Tried it a couple of mintues ago and everyime I'm trying to reference something, it doesn't fucking work (something wrong with my application, not the control)!!
May be someone could help me and get this sorted once and for all, I'd appreciate that a lot. I'll talk you through what I did to give you a better picture:
the application is located @ http://sergeio.co.uk/rus2eng/
(translating russian to english, so the client is meant to upload the text through CKEditor, the data is then entered into a sql database)
I'm sure you've come across with this type of error before:
"Could not load file or assembly 'SyrinxCkEditor' or one of its dependencies. The system cannot find the file specified."
I have a Bin foder, I added SyrinxCkEditor.dll through right clicking on Bin folder and "Add Reference" (using VS08). Then at the top of the page I added the following:
<%@ Register Assembly="SyrinxCkEditor" Namespace="Syrinx.Gui.AspNet" TagPrefix="syx" %>
And then in the <body> added the following code:
<syx:CkEditor runat="server" id="ed1" />
I've been having the same issue with FreeTextBox (that's why I looked towards CKEditor).
I don't know what to do anymore. Thanks in advance!
Attachments:
Re: New ASP.NET CK Editor v3 control available!
It seems you are fundamental problem with properly setting up your asp.net site and making references to an external assembly. I tried to look at the site, but all I am seeing is an http 500 error.
Are you able to run the demo site ok?
Re: New ASP.NET CK Editor v3 control available!
1 more thing.. Im dutch and http://syrinx.ph/articles/SyrinxCkEditorDev.aspx is translated in dutch... I cant even read it because of the bad grammar! How do I read it in english...?
Re: New ASP.NET CK Editor v3 control available!
Can I blame it on my hosting then (it works locally, but not online)? As far as I'm aware they're allowing medium trust level for applications, would that be an issue?
You said I have a problem with setting up asp.net application -- do you know what the problem is?
Thanks man.
Re: New ASP.NET CK Editor v3 control available!
When I run youre test project then it is working fine. But when I run it on a page within a masterpage, firebug is giving me the following error:
and the following is given:
I don't know if it has something to do with masterpages?
Greetz Cezus
Re: New ASP.NET CK Editor v3 control available!
Solved 2 problems,
first from my reply before this one. That was by replacing my own downloaded ckeditor source by the one from the demo. It seems that it is not possible to download your own source. Solved.
edit: Related to the problem below.
The second problem that I had was that the reference to the script was wrong. The following is original on line 21 in the demo:
notice the forward slash "/" where the path begins with. After removing this "/" at the beginning it worked!
Hope this helpes?
Re: New ASP.NET CK Editor v3 control available!
I'm uploading a fix for this right now. Thanks for reporting the issue.
Re: New ASP.NET CK Editor v3 control available!
Re: New ASP.NET CK Editor v3 control available!
Under which circumstances are you not getting the Text value? I just tested this again, and ifI type some text in the editor and then change the language or theme with the asp.net drop down controls, the Text is properly getting set and can be retrieved via the Text property. If you check the value of the Text property on first page load and have not set the Text property to some starter value than you will get a NULL as you stated, but this is the way it should work.
Please provide more information to fully understand the situation you are experiencing this problem.
Re: New ASP.NET CK Editor v3 control available!
Hmmm, sorry, but first I have got to test something. It does work on single page, but on page with multiview - it doesn't work.
It doesn't even work on child of MasterPages.
I checked it, and it doesn't run LoadPostData on it, while on clean page - it does.
(sorry for my bad english :/)
Re: New ASP.NET CK Editor v3 control available!
More details please!
Thanks
Re: New ASP.NET CK Editor v3 control available!
Yes, correct. It doesn't work in contentplaceholder, even on my masterpage. I searched through forums and I've founded, that some guy have got the same problem (with his own control), but it gone away, when he put this: Page.RegisterRequiresPostBack(Editor), into Page_PreRender. When I have added it to my code-behind contentpage it fires up the LoadPostData, but the Text from control is still null.
For test what i've done - i've made an empty default page in VS, and added to it, a button and your control, in code-behind i've added that text of this button have to change to text from control - it worked.
Second page, was a content page built on masterpage, same button, and your control, but text was empty :/.
Well, i don't know if this help - i have to have ValidateRequest = false in my @Page, because without my page raise an error, that this content is not safe. But i have the same attribute in single page and this does work.
Re: New ASP.NET CK Editor v3 control available!
Well, I have solved my issue, by doing everything in http://docs.fckeditor.net/CKEditor_3.x/ ... ntegration. I'm not using your control right now, I've lost a day to run it... Sorry...
For those, who will have problem with ContentPlaceHolder in asp.net - try to iterate in javascript through your controls to find a name, because .net is changing name = id accordingly to with content it is in it. also give a textarea an runat="server" and an id name. Then using innerHtml or innerText (depends on what you need) take/set your text.
(JavaScript below:)
nameOfYourEditor - without ' or ".
Re: New ASP.NET CK Editor v3 control available!
Well, I'm sorry that you've lost a day to it. I did create a new master page and page that uses it in my demo site. It worked just fine out of the box. If you look at the code for the ASP.NET control I created, you'll see that it uses ClientID for the javascript code it generates to setup the editor.
The reference you make to calling RegisterRequiresPostBack has nothing to do with master pages. That call is specifically about ensuring that the ASP.NET library's __doPostBack javascript function is sent with the page. This control does not need __doPostBack to function. It will send its text back in a ASP.NET postback, but there is nothing about the editor that will trigger a post back like an ASP.NET button or a drop down with its AutoPostBack property set to true. Those controls do need the __doPostBack to be on the page in order for them to trigger a post back when the user does something with them (like press the button or select an item from a drop down).
I believe you are doing something else improperly in the master page environment. Just so that people new to this control can see it work for themselves, the demo site included in the code drop on codeplex now demos the control in a standard page, in a master page environment and as a user control being used in a page.
Re: New ASP.NET CK Editor v3 control available!
Hey, relax!
, it's OK - simply i wanted to test it, and wished to find a solution to it, but my project is now more important right now than this. I was looking for something fast and reliable
. This control with you have made is really good, and I'm appreciated to your work
. And I've learned a lot of things searching through forums and trying to find the solution
.
But...
It doesn't work either...
What I have done - firstly I've unloaded my last solution, reloaded the VS, loaded your solution. To your TestMaster.aspx I've added a simple button with an OnClick event. Secondly, in his codebehind added simple: button.Text = ed1.Text. It doesn't work on first time, because it raised the security error with says that I've had to add an ValidateRequest=true, to turn this checking of. After that I've run it one more time - the button.text is empty! Check this on your computer, if it does working, well then I don't know. Maybe it's something with my operating system (Windows 7), or IIS 7, or something else, but I've used your files!
Re: New ASP.NET CK Editor v3 control available!
I'm sorry if I came off as being rude. I didnt mean it, promise! I'm very happy to have someone use the product in different ways than I do so that all the bugs can be fixed!
You were right! Arggg..
I did fix it and updated the v1.2 drop. The problem was that I was using the ASP.NET ClientID property for both the id and the name attributes of the textarea that will be turned into the editor. However, in a master page scenario, this will not cause the LoadPostData method of the control to get called, which is what gets the Text property setup. I simply changed the Render method to render the text area to use ClientID for the id attribute and UniqueID for the name attribute which is the correct way to do this. Now the code works properly in the scenario you describe.

Thanks for you feedback!
Re: New ASP.NET CK Editor v3 control available!
Glad, that I could help
. This product is really good (CkEditor
) , so for programmers (beginners - I think) that are going to make a CMS (or something) your control with CkEditor is a good thing to start with
. Offtopic - God, it's late now 
. But they have only code without the control on site, so hmmm...
Think, about an installer or something - just like the guys from nunit have done
Re: New ASP.NET CK Editor v3 control available!
Good luck!
Matt
Re: New ASP.NET CK Editor v3 control available!
Okey thnx!
What is your company's solution to upload images in the editor? There is no upload available yet in version 3.0.
Re: New ASP.NET CK Editor v3 control available!
I use CKEditor in my Syrinx CS, which is a full site package. It has a image/video upload solution that is custom to it. Basically, it uses an iframe within a popup browser window. The user uses regular file upload buttons and submits the form which is all in the iframe. When the upload is complete, the main window knows it and updates its display using javascript. It appears seamless because of the iframe and the fact that the mail page using the iframe doesnt refresh during this process.
Re: New ASP.NET CK Editor v3 control available!
Okey.. That sounds that i have to write my own upload plugin for now
Do you have a javascript plugin template that will load my custom asp.net upload control? 
Re: New ASP.NET CK Editor v3 control available!
I've tried the control but I'm unable to get it to work I keep getting the following error: Line: 17
Error: 'CKEDITOR' is undefined. This happens when running a test page, any suggestions on a fix.
Thanks
Re: New ASP.NET CK Editor v3 control available!
Re: New ASP.NET CK Editor v3 control available!
You should review the CkEditor.cs file, and checkout the setupScripts method. Is the one line of code in there using page.ResolveUrl ? If not, you need to download the latest.
Re: New ASP.NET CK Editor v3 control available!
I am using the latest version of the .NET control, and I am getting this error when trying to use the normal process defined for specifying an uploader:
[CKEDITOR.editor] The instance "'+z.name+'" already exists.
This is my code, in its entirety:
If I remove the call to replace I don't get the error, but then I also can't get my uploader registered. I'm not sure if this problem is in the SyrinxCkEditor, or in CKEditor itself, or in something I'm doing.
Any help you can provide would be greatly appreciated. Thanks!
Re: New ASP.NET CK Editor v3 control available!
syx1.onClickSave
Which would then call a subroutine which I could use to do something like this:
dbTextContents = syx1.Text
The postback works okay, but what if I don't want the data to be saved on every postback?
Dave.
Re: New ASP.NET CK Editor v3 control available!
yeah, i've tested this syrinx control out, it seems to have problems with partial page postback (can't use update panels, it must be a full page postback for syrinx to work)
you can all test this control out (works with update panels and partial page postback)
viewtopic.php?t=15882
its even updated itself to support 3.2 ckeditor
for those who are interested for uploading files with ckeditor to a database, check this project out
http://ckfilemanager.codeplex.com/releases/view/39131