text: The code for this article and a sample website can be downloaded here. An online version of the sample website can also be found at. This article is a continuation of the previous AJAX Extender for TinyMCE which can be found
  The download provided does not contain tinymce. Please download it seperately.
  After I published the previous AJAX Extender it got quite some attention, questions and remarks and was obviously wanted by the community. Because of this reason and my own frustrations with the limitations of the current extender I used some spare time to create a new version with options to easily configure a tinymce editor on any textarea element, totally independent of the other element.
  The results of all the work can be found in the sample website.
  All there is to adding a tinymce editor to any textarea element looks like:
  Customization of the control can be obtained by using the InitList property and adding the elements much like:
  " Theme="advanced"> <InitList>  </InitList></tm:TinyMCETextBoxExtender>
  And it gets even better when you put the above in a .skin file
  " SkinID="CustomSkin" />
  Hi siets... I found you original article a week or so ago. Even though I noticed you were still working and enhancing the original extender I started to use your code as a base. Have you thought about starting a codeplex project for it because of the great benefit your code could provide to the community?
  Here are a few missing pieces that I tweaked in your original code and believe would make it better:
  1. Add a "tinyScriptPath" property so that the location of "tiny_mce.js" can be dynamically provided.
  2. Implement GZip compression.
  3. By default the .NET 2.0 framework has validateRequest="true", this caused me a bit of a problem when it passed the html created by tinyMCE to my codebehind. So I implemented <a href="tinymce.moxiecode.com/.../viewtopic.php fix from the MoxieCode forums</a>.
  I added the following methods to the behavior.js in the TinyMCETextBox namespace:
  <code>
  TinyMCETextBox.dotNetCustomCleanup = function (type, value) {
  if (type == "insert_to_editor") {
  value = value.replace(/</gi,"<");
  value = value.replace(/>/gi,">");
  }
  return value;
  }
  TinyMCETextBox.dotNetCustomSaveContent = function (element_id, html, body) {
  html= html.replace(/</gi,"<");
  html= html.replace(/>/gi,">");
  return html;
  </code>
  Finally I added the following to the init method:
  ,cleanup_callback : "TinyMCETextBox.dotNetCustomCleanup",save_callback : "TinyMCETextBox.dotNetCustomSaveContent"
  Oh... one more thing I had to tweak.
  Becase an extender is for a specific control or "textbox" and you're using "mceAddControl" the correct mode to use would be "none".
  Source:
  wiki.moxiecode.com/.../mode
  SovereignLizard,
  Thank you very much for your thorough examination and feedback. I really appreciate it.
  1.tinymceScriptPath
  Good idea!
  2. GZIP compression
  Good idea as well. I wanted the future for this version already but it seemed to have totally slipped my mind.
  3. Bypass validateRequest
  Although I can see where it comes from, and it is a valid point, I do not completely agree with this statement.
  Posted HTML should never be trusted by any website and the validateRequest option makes sure it is not. Developers should know about this option and use it appropriately. This extender should not bypass validateRequest.
  I'll think about adding this option but I will make sure that an additional property (AllowPostedHTML) is checked before the code is executed on the client and server.
  4. Proper usage of tinymce mode property
  I'll look into it.
  5. Codeplex project
  I'll look into it. It never occured to me that it could be an OS project. I'm not at all familiar with open source as I usually deal with closed source. Hence probably why there is a lack of comments in my code ;-)
  I looked at your new version a bit, looks good. I like the option enum you implemented.
  I definetly agree about "validateRequest" I don't believe it should EVER be turned off. The problem was, in my case, unless I came up with an alternative solution that would have been my only choice. The way I implemented is using tinyMCE core functionality (cleanup_callback and save_callback) events. All it is doing is changeing all <> characters into their html equivilants so even if the code was printed directly to a website it would only display it as such and not interperate it as html or script code. Not only that, but if you use tinyMCE correctly it prevents unauthorized tags from being passed.
  That's just my "two cents" ;).
  Hi,
  It was a great help to find this page after doing a lot of search for some good and easy way to have a Rich Text Box within my ASP.NET application.
  Although, it took some time to configure things related to TinyMCE and your provided code had to be re-compiled against the latest download of Ajax Control Toolkit to work, but at last it wask working and it was breeze for me that it worked so smoothly on the localhost.
  However, when I uploaded my site to the production server and I tested the page with the TinyMCE Editor along with your Extender Control, I am being presented with two JavaScript Error messages on load. The modified screen-shots are available here in the sequence they appear:
  moghazali.googlepages.com/2008-06-21-TinyMceExtenderJsError1On.bmp
  moghazali.googlepages.com/2008-06-21-TinyMceExtenderJsError2On.bmp
  Nothing else happens after these errors and editor is displayed and I have even tested that appropriate button submission/postback is working fine.
  The above errors are displayed only in IE 7 and no such errors were prompted when I tested with Firefox. My current work environment is VS 2008 with ASP.NET 3.5.
  Please guide to remove these errors so my production site would be free from errors presented to users.
  Thank you in anticipation for your help.
  1. Did you upload the control?
  2. Does your online web.config contain all the configuration elements required to get AjaxControlToolkit to work? Some elements (like ScriptResource.axd) are used to extract the resource from the assembly.
  Hi...
  I'm desperately trying to get this working in ASP.NET 3.5 (VS2008) but when I rebuild the site I get this error...
  Unable to create type 'cc:TinyMCETextBoxExtender'.)
  I've copied TinyMCETextBox.dll from the download into my BIN folder. I'm using a AJAX enabled site so already have AjaxControlToolkit.dll but it's version 3.0.20229.0 rather than 1.0.10920.0. My web.config looks fine btw.
  Any help would be really appreciated.
  Thanks
  Hi Stuart,
  Please open the project. Remove the AjaxControlToolkit reference (and dll) and recreate the reference to the newer AjaxControlToolkit that you are using.
  Once recompiled it should work.
  Cheers,
  CJ.
  Hi CJ...
  Thank you very much for your help, I really appreciate it. It's now working perfectly.
  Stuart
  Does this control only work with version 1 of the Ajax Control Toolkit? I can't seem to get it to work with v3.5
  Oops, I forgot you get the source code with the download! Ignore my previous post, I just changed the reference in the project and recompiled
  Is anyone else getting a 'e is null' javascript error (in the tiny_mce file) when using the 3.5 ajax control toolkit? As far as I can see 'e' is a reference to the tinymce textarea. The postback doesn't hold the value in the textarea either...
  Thanks for the awesome work! I'm having great success with IE, but not working properly with Firefox 3.0. After a first postback, the editor disappears. After another postback, it works again. I haven't really delved into the code but I'm not sure what is up... any theories? The problem can be easily reproduced by visiting the demo site above in FF 3 and hitting the postback button.
  I'm getting the "e is null" error in firefox when I just take take the sample site, use one control in an update panel and convert it to use master pages. The first time I submit I get the error. But then if I submit again the error doesn't appear?
  Have a look at this url for more information about that issue:
  tinymce.moxiecode.com/.../viewtopic.php
  The 'e is null' error is even happening on the sample site!
  Hmm, I'm not sure what's going on here. I've been digging for a little while now, and have still come up empty as to why this isn't working. In IE7 the RTE doesn't even load. In FF2 it loads, but Firebug throws an error.
  TinyMCETextBox is not defined
  $create(TinyMCETextBox.TinyMCETextBoxBehavior...)
  I looked at it seems that the Type.registerNamespace isn't being executed. Somehow the js resource for behaviors isn't being loaded? I checked the project & it's an embedded resource.
  I figured I'd leave a post here & see if it's my own stupidity doing this, or if it's a genuine bug. I'd appreciate any feedback I can get, and thanks a lot for the control! The effort is very appreciated. If I do anything different with it, I'll certainly let you know.
  I'm having a problem with this extender. I have a treeview of files in a directory that will be loaded into the editor, but when I click on a file and load its contents into the editor, tinyMCE disappears and only shows the textarea. What could be the problem here?
  This extender is great! I have used the first version for a while, but after the release of Firefox 3 it stoped work properly. The toolstrip in TinyMCE is visible but the textarea part is laying behind the controle and is not visible. I have downloaded this later version and discovered that the problem remains.
  Does anyone have the same problem or is it somehing in my settings I can change to resolve this issue.
  I should have mentioned that it works fine in IE7, but not in FF3. It only not loads the first time a node from the treeview is clicked. After that, each selection properly loads into the editor.
  Anybody else having issues with FF3?
  I'm not having any luck with FF3 either (same as vhpinfl). I'm going to take a look at the code and see, but I'm not sure if I'll be able to figure it out or not. Anyone know what the problem might be?
  Have been on quite a nice holiday and noticed the many lot of comments. Thank you!
  Again - it might take a little while but I have made note of your comments and will work on the implementation for VS2008, AjaxControlToolkit3.5 and even FireFox 3.
  When released it will probably become a community project as well so it is easier for others to help.
  Sounds great, thanks!
  Good extender, but he need ability to specify path for tinymce directory
  Nice work, question: is this work also on opera and firefox? i tested, it seems to be working ok only in ie, on opera anf ff, editor is gone.
  Above someone siad they got the extneder to work wiht 2008/3.5 and the newer ajax toolkit. I removed the reference and re added it, and it still does not work?
  Is there any solution yet?
  And, since I can't get it to work, I'm wondering if this will allow postback and not get the 500 error?
  Great work, Siets. Hope your work is doing progress. I would really appreciate if you put the project on Codeplex as you hinted in a earlier post.
  I think alot of developers who used this piece of code has done some modifications to it that makes it even better.
  If we had it on codeplex we could all contribute to the source.
  There is an easy fix for FireFox 3. Change the mode attribute to none, instead of textareas. This seems to fix the problem - but I will delve a bit more into it now I have the time available again.
  First off, I wanted to thank you for making this extender, it really helped me out. I was just curious if there is any way to get it to work with a ModalPopupExtender... I keep throwing a "Microsoft JScript runtime error: 'DOM.get(...)' is null or not an object" exception every time a postback occurs with a hidden panel attached to a ModalPopupExtender.
  Never mind, this was my mistake... remember to turn your smart navigation off when using this control!
  I have rebuilt the extender with the newest version of the AJAX Control toolkit, changed the mode attribute to none for Firefox and added the black o2k7 skin. All is well except for posting back in an update panel in Firefox 3. When I do a partial postback the editor is reloaded without the data. If I do a full page postback the data returns. Do you have any ideas on a fix for this issue?
  Noticed an odd little bug, when you add stuff to the init list via the extender, when adding var's that take a boolean value, the extender will pass the following to tinyMCE.init:
  var : 'true' or var : 'false'...
  Which is always true... since any non null string returns evaluates to true in javascript. This is a big time bug when needing to turn off certain tinyMCE (in my case converting url's)
  Although, that can be fixed by leaving the string empty, which javascript evaluates to false. ;)
  I've downloaded the last version of this extender and tried to deploy it on vs2008 .net 3.5.
  Went through the step of opening the project, replace the Ajax 1 reference with Ajax 3 refence, but still I'm getting an error when trying to run it...
  basically it returns an object reference not set to an instance of an object at: this.Page.Header.Controls.Add(Include);
  wheren header is returning null.
  Am I missing some type of configuration? PLS help!!!!
  Thanks A lot
  Have someone been able to find a workaround when using ASP.NET 3.5 and its AJAX toolkit?
  I have tried the suggestions above of adding reference etc, but I still get the following compile error in VS2008:
  Error 2)
  Hi people,
  I've an js error like: tinyMCE is not defined
  I use VS2008/.NET3.5....and I use AjaxToolKit v3.
  I tested your live example1 in Firefox 3 and find that the TinyMCE disappears on postback. Has there been any resolution for Firefox 3 yet?
  Interessante Informationen.
  Sehr wertvolle Informationen! Empfehlen!
  I only have visual web developer and can't build dlls. I need a version compat with 3.0.20820 ajaxcontroltoolkit.dll
  How can I access the value of tinyMCE editor in codebehind to save it to the database?
  Is very good control, but how to decide the issue with the error data?
  I just want to add my thanks for this extender. Having thought I'd cured my tinyMCE/UpdatePanel issues, I found this which really did solve them. I did have to recompile it because I have a customised version of the AjaxToolkit, but it worked perfectly. Thanks.
  New Ajax Toolkit and Im getting the error:
  Could not load file or assembly 'AjaxControlToolkit, Version=3.0.20820.16598,
  Its OK, I just updated the project to .net 3.5 and added the latest AJAX Toolkit
  It works good but a little bug occurs if I turn off partialrendering on the scriptmanager so I can see exceptions properly.