Adam,
I just found a new issue that caused by the method you provided. Afer executing the following code, the background changed. But, if I click a submit button to post back the form immediately without doing any action on the editor (e.g. switch view), the Editor1.Text returns the old content.
var editor1 = document.getElementById('<%= Editor1.ClientID%>');
var editdoc = editor1.GetDocument();
editdoc.open("text/html","replace")
editdoc.write(h);
editdoc.close();
I guess the editor must has an internal variable to tell if the text is changed. The function setHTML() can set the variable but above code can't. Could you please tell me how to set the variable to let the editor know the text is changed?
Currently, my workaround is to call setHTML(h) after executing the code above. It works, but doesn't sounds good.