DCSIMG
tinyMCE - The best WYSIWYG editor! - Gilly Barr

tinyMCE - The best WYSIWYG editor!

Searching for a WYSIWYG editor :
I've been searching the internet these past few days for the best free WYSIWYG editor...
For those who aren't familiar with the term - WYSIWYG is an abbreviation for What You See Is What You Get editor. It's those small word editors you see on sites like this one that allow you to use rich text and even view your text in html.

I've been using these editors for sites i've been building for quite a while, finding them very comfortable.
I used to use fckEditor in the past (which is a great editor), when I programmed mostly in PHP. But now I wanted something more comfortable for .net...

tinyMCE and it's benefits :
Now I found tinyMCE which I think is the best, at least for the .net fans among us.
 - For starters, they have their own control you can add to your toolbox. You just download the dll, add it to your toolbox and drag it to your aspx design page!
 - Of course they have all the regular options you can ask for in a regular editor - colors, links, images, formatting text, numbering, etc....
 - Another thing I like is that it works great with "invisible" tables, meaning you can add a table and give it border=0 and still see the border while editing. This might sound trivial but i ran into an editor (even two) that couldn't do this.
 - It has a bunch of plugins you can choose from like automatic spell checker, emoticons, find/replace dialog, and more...
 - Compatible with all the main browsers (FireFox, IE, Opera...)

- The last benefit, which I'll explain in detail is:
Getting tinyMCE to work in an UpdatePanel :
My current project uses alot of UpdatePanels and partial updates. In some cases I need to load the WYSIWYG editor in a partial update. I thought this would be easy, and at first I tried with two other editors. I tried tweeking the code and getting it to work, but the closest i got was making one of them work in IE but not in FireFox.

I got tinyMCE to work with minor fixes :
First add the tinyMCE with all the properties you want to your aspx page. (not inside an UpdatePanel for now, recommended just some test temporary page)


For the editor to work in any case, you need to make sure you downloaded the js files, placed them in your project, and add some settings to your web.config. I just downloaded the .net sample from their site and copied the new settings.
Now, open the page in your browser, and view the pages html source.
You need to copy the javascript part that initializes the editor and place it into a string in your code-behind.


The highlighted text is what you need to copy to a string in your code...



Notice the last function call to ScriptManager.RegisterStartupScript which is how our javascript code is triggered when the UpdatePanel is updated.

I hope you can enjoy it as much as I do...

* This is not meant to be a commercial (by that I mean that im not getting sponsored in any way to publish this post :)

Published Saturday, December 20, 2008 5:05 PM by gillyb

Comments

Friday, May 01, 2009 4:02 PM by Moody

# re: tinyMCE - The best WYSIWYG editor!

Can your please share the source code of your findings.

I am working on a project which required online page editing and using tinymce for the editing of the div contents.

I am unable to understand your implementation in this article. as far as i know there is no .net dll is provided with TinyMCE to use in asp.net pages like FCKEditor does...

Friday, May 01, 2009 6:18 PM by gillyb

# re: tinyMCE - The best WYSIWYG editor!

Hey,

Check out there site at tinymce.moxiecode.com and go tot the download page. They have a .net package, that comes with a server control you just need to drag on your aspx page.

The small modifications i was talking about are to get the tinymce editor to load inside an update panel which was trouble for me...

Try downloading there control and then reading my post again.

If it still doesn't work for you, then email me and ill try to send you a demo solution done already.

I think tinyMCE is better than FCKeditor, which i used to use in the past. (although FCKeditor is probably 2nd in my opinion, so not that bad a choice...)

Gilly.

Wednesday, May 06, 2009 1:10 AM by Robbieg

# re: tinyMCE - The best WYSIWYG editor!

Tried the code above and doesn't work for me.  I placed a button on a page and as soon as I post back, the button disappears and I get a 'permission denied' error. I'm working on 'localhost' so I can't imagine a cross domain scripting issue.   Can you send me a working solution for this?  Just curious as to what I may be doing wrong.  

Monday, June 01, 2009 9:33 PM by Adin

# re: tinyMCE - The best WYSIWYG editor!

And now The AjaxControlToolkit has its own! www.asp.net/.../HTMLEditor.aspx

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: