I've spent most of the day trying to sort out the same problem and have come up with simple solution. My editor is in a form that has two modes: readonly and edit/insert, so I add and remove the tinyMCE editor dynamically; I only need it in the edit/insert mode. Eg:
var notesID = "<%=NoteDetails.ClientID%>";
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
function pageLoaded(sender, args) {
var currentMode = document.getElementById('<%=CurrentMode.ClientID%>');
switch(currentMode.innerHTML) {
case 'view':
removeEditor();
break;
case 'edit':
initialiseEditor();
break;
case 'new':
initialiseEditor();
break;
}
}
function initialiseEditor() {
tinyMCE.init({
mode: "exact"
, elements: notesID
, theme: "advanced"
, theme_advanced_toolbar_location: "top"
, theme_advanced_toolbar_align: "left"
, theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect|,help"
, theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor"
, theme_advanced_buttons3: ""
, plugins: "inlinepopups"
, dialog_type: "modal"
});
}
function removeEditor() {
if (tinyMCE.getInstanceById(notesID) != null && tinyMCE.getInstanceById(notesID) != "undefined")
tinyMCE.remove(tinyMCE.getInstanceById(notesID));
}
This works well for me since I also need to run other script when the mode switches (removed from the above code for clarity), so ties in neatly. The CurrentMode element is simply a Label control set in server code.