This is a migrated thread and some comments may be shown as answers.

Error when setting HTML in the RadEditor Content property

2 Answers 264 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Karl-Heinz
Top achievements
Rank 1
Karl-Heinz asked on 18 Dec 2017, 12:09 PM

Hi,

 

I am getting an javascript error message on client side when loading HTML into the Content property of the RadEditor control:

textEditor.Content = "<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><p><span>qdwqwdwqd</span></p></body></html>";

 

The error I am getting is a popup saying:

Error! Set EditorContentAreaMode to Iframe if you want to edit full page HTML!

The editor control is defined in the asp.net user control markup as :

<rade:SPRadEditor RenderMode="Classic" ID="textEditor" Runat="server"
    EditModes="Design" Language="nb-NO" OnClientLoad="editorLoad" OnClientSubmit="OnClientSubmit" ContentAreaMode="Iframe">
</rade:SPRadEditor>

 

I have also checked while debugging that the ContentAreaMode is set to Iframe while debugging.

The content is set in the editor, so that is fine. I just need to get rid of the error popup message.

 

Does anyone know how to either configure the editor to fix this or if it is possible to supress the error message in any way?

 

Best regards,

Geir Morten Hagen

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 19 Dec 2017, 07:29 AM
Hello,

Can you try to load the string as 

textEditor.Content = @"<html xmlns='http://www.w3.org/1999/xhtml\'><head><title></title></head><body><p><span>qdwqwdwqd</span></p></body></html>";


as well as a second test to set the ContentFilters property to None?

For your convenience I have attached my test project which works fine on my end. If you are unable to solve the issue, modify the project and send it for examination via a support ticket.

Kind regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Karl-Heinz
Top achievements
Rank 1
answered on 19 Dec 2017, 08:50 AM

Hi,

 

thanks for the quick reply.

 

the suggestion with using @ and setting ContentFilters to None did not work unfortunately. However, the issue was solved by stripping the string set in Content of the html-tag and keep head and body.

 

Best regards,

Geir Morten Hagen

Tags
Editor
Asked by
Karl-Heinz
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Karl-Heinz
Top achievements
Rank 1
Share this question
or