New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Change RadEditor ContentAreaCssFile on client side

Environment

ProductRadEditor for ASP.NET AJAX

Description

See how to change the RadEditor ContentAreaCssFile on the client by updating the href attribute of the iframe content area CSS file

Solution

Here is the implementation:

ASP.NET
   <script type="text/javascript">
        function OnClientLoad(editor) {
            setTimeout(function () {
                var head = editor.get_document().getElementsByTagName("HEAD")[0];
                $telerik.$(head).find("#RADEDITORSTYLESHEET0").attr("href", "EditorContentAreaNew.css");
            }, 200);
        }
    </script>
    <telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad" ContentAreaCssFile="EditorContentArea.css">
        <Content>
            <div class="myClass">sample content</div>
        </Content>
    </telerik:RadEditor>
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support