Hi gll1559,
Please try the example below, it shows you how to change the editor body style dynamically in javascript code.
- <%@ 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";
- }
- </script>
- </form>
- </body>
- </html>
Regards,
Ken