Search results

Iframe

When the iframeSettings option is enabled, the RichTextEditor creates the iframe element as the content area on control initialization; it is used to display and editing the content. In content area, the editor displays only the body tag of a < iframe > document.

razor
iframe.cs
@Html.EJS().RichTextEditor("iframe").Value((string)ViewBag.value).Height("500").IframeSettings(iframeSettings => iframeSettings.Enable(true)).Render()
public IActionResult Iframe()
{
ViewBag.value = @"<p>The rich text editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content. 
Users can format their content using standard toolbar commands.</p>
<p><b> Key features:</b></p>
<ul><li><p> Provides & lt; IFRAME & gt; and & lt; DIV & gt; modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>

<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>

<li><p> Provides a fully customizable toolbar.</p></li>

<li><p> Provides HTML view to edit the source directly for developers.</p></li>

    <li><p> Supports third - party library integration.</p></li>

    <li><p> Allows preview of modified content before saving it.</p></li>

    <li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>

    <li><p> Contains undo / redo manager.</p></li>

    <li><p> Creates bulleted and numbered lists.</p></li>

    </ul>";

return View();
}

IFrame attributes

The editor allows you to pass an additional attribute to body tag of a < iframe > element using attributes fields of the attributes fields of iframeSettings property. This property contains name/value pairs in string format. It is used to override the default appearance of the content area.

Adding external CSS/Script File

The editor offers you to add external CSS file to style the < iframe > element. Easily change the appearance of editor’s content using an external CSS file using styles field in iframeSettings property.

Likewise, add the external script file to the <iframe> element using scripts field of iframeSettings to provide the additional functionalities to the RichTextEditor.

razor
external-css.cs
@Html.EJS().RichTextEditor("iframe").Value((string)ViewBag.value).Height("500").IframeSettings(iframeSettings => iframeSettings.Enable(true)).Render()
 <script>
        var iframeRTE;
        function created() {
            iframeRTE = this;
            this.setProperties({
                iframeSettings: {
                    enable: true,
                    attributes: {
                        readonly: 'readonly'
                    },
                    resources: {
                        styles: ['myStyle.css']
                    }
                }
            }, false);
        }
</script>
public IActionResult ExternalCss()
{
ViewBag.value = @"<p>The rich text editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content. 
Users can format their content using standard toolbar commands.</p>
<p><b> Key features:</b></p>
<ul><li><p> Provides & lt; IFRAME & gt; and & lt; DIV & gt; modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>

<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>

<li><p> Provides a fully customizable toolbar.</p></li>

<li><p> Provides HTML view to edit the source directly for developers.</p></li>

        <li><p> Supports third - party library integration.</p></li>

        <li><p> Allows preview of modified content before saving it.</p></li>

        <li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>

        <li><p> Contains undo / redo manager.</p></li>

        <li><p> Creates bulleted and numbered lists.</p></li>

        </ul>";
return View();
}