Error when setting HTML in the RadEditor Content property

3 posts, 1 answers
  1. Karl-Heinz
    Karl-Heinz avatar
    7 posts
    Member since:
    Jun 2014

    Posted 18 Dec 2017 Link to this post

    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. Answer
    Rumen
    Admin
    Rumen avatar
    13659 posts

    Posted 19 Dec 2017 Link to this post

    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.
  3. Karl-Heinz
    Karl-Heinz avatar
    7 posts
    Member since:
    Jun 2014

    Posted 19 Dec 2017 in reply to Rumen Link to this post

    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

Back to Top