Hi gll1559,
Please try the new example below, it should work.
- <%@ Page Language="c#" ValidateRequest="false" %>
-
- <%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>example</title>
- </head>
-
- <body>
- <form id="Form1" method="post" runat="server">
- <RTE:Editor ID="editor1" runat="server" />
- <input type="button" value="change editor body style" onclick="styleChange()"/>
- <script type="text/javascript">
-
- function styleChange() {
-
- var editor1 = document.getElementById('<%= editor1.ClientID%>').editor;
-
- var editwin = editor1.GetWindow();
- var editdoc = editwin.document;
-
- editdoc.body.style.backgroundColor = "red";
- }
- function RichTextEditor_OnExecCommand(editor, arg) {
- var a0 = arg.Arguments[0];
- if (a0 == "Undo")
- {
- setTimeout("styleChange()", 1);
- }
- }
- </script>
- </form>
- </body>
- </html>
Regards,
Ken