IFrame Editing Mode in ASP.NET MVC Rich Text Editor

18 Nov 20181 minute to read

The iframe editor in the Rich Text Editor control provides an isolated environment for content editing. It uses an iframe element to create a separate document, ensuring better compatibility and separation from the parent page’s styles and scripts. In this mode, the editor displays only the body tag of the iframe, offering a clean and isolated workspace for content creation.

Configuring the Iframe Editor

To enable the iframe editor, you can use the IframeSettings property. When this option is enabled, the Rich Text Editor creates an iframe element as the content area during initialization.

Here’s an example of how to enable the iframe editor:

Customizing IFrame Attributes

You can add custom attributes to the body tag of the iframe using the attributes field of the IframeSettings property. This property accepts name/value pairs in string format, enabling you to override the default appearance of the content area.

Integrating External CSS and Scripts

The Rich Text Editor allows you to apply an external CSS file to style the iframe element. This can be done using the styles field in the iframeSettings property. By including an external CSS file, you can easily change the appearance of the editor’s content to meet your specific requirements.

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

You can also explore our iframe in ASP.NET MVC Rich Text Editor example that shows how to render the iframe in Angular Rich Text Editor.

See Also