Automatic modifications in Rad Editor

6 posts, 0 answers
  1. Naupad
    Naupad avatar
    23 posts
    Member since:
    Dec 2011

    Posted 25 Jan 2012 Link to this post

    I am getting XSL data in the RadEditor with EditMode as HTML in the mark-up. But the Editor is automatically modifying my XSL data and showing it in Rad Editor. I want exact same data to be shown. I tried adding ContentFilter="ConvertToXhtml" but it didn't work.

    What should I do to show my XSL data in Rad Editor exactly same as in database?

    FYI: I have set Rad Editor in Editmode="HTML" so there is no option of switching modes.

    HELP!!!!!!!!!
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 26 Jan 2012 Link to this post

    Naupad:

    You should understand that RadEditor is primarily designed to be an HTML Editor and not for editing XML. RadEditor can really be thought of as an advanced <asp:TextBox> and that it's exported content is a standard string.

    Since your XSL content is not HTML, once it gets loaded in the iframe content area, the rich text engine of the browser and RadEditor's filters will modify it, trying to validate it using HTML rules. RadEditor's filters, by default, will try to convert it to XHTML.

    You can disable RadEditor's built-in content filters and the editor will leave the browser to change the content:
    <telerik:RadEditor ID="RadEditor1" ContentFilters="None" runat="server" />

    Then, it is up to you to handle the exported content and write it in the required way in the desired location.

    Hope this helps!
  3. dorina
    dorina avatar
    8 posts
    Member since:
    Dec 2010

    Posted 10 Jul 2012 Link to this post

    Hello,

    I have the same problem with XML/XSL. I've set ContentFilters="None"  but the content is changed anyway. Is there another solution to this issue?

    Thank you.
  4. Rumen
    Admin
    Rumen avatar
    14417 posts

    Posted 10 Jul 2012 Link to this post

    Hi,

    When the ContentFilters property is set to None, RadEditor does not modify the content, but the browser's rich text editing engine.

    You can test your XML content with the attached editable iframe html page. Load it in the browser, enable the JavaScript, load your custom content in the editable iframe and see how the different browsers will modify it. Note that the HTML page does not have a DOCTYPE and it will be rendered in quirksmode. You can use the IE developer toolbar to change the mode to IE9, IE8, IE7 and see how the rich text editing engines of the different versions of IE behave.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. dorina
    dorina avatar
    8 posts
    Member since:
    Dec 2010

    Posted 10 Jul 2012 Link to this post

    Hello,


    Thanks for your reply.
    Yes you were right, my content completely changes in iframes. But, why setting ContentAreaMode="Div" 
    doesn't change the behaviour of RadEditor(I mean the XML/XSL changes in both cases).

    Thank you
  6. Rumen
    Admin
    Rumen avatar
    14417 posts

    Posted 12 Jul 2012 Link to this post

    Hello,

    The behavior could be due to that the div content area is part of the same page and the page DOCTYPE is applied to it. The iframe content area is another document, which does not have applied by default a DOCTYPE. You can apply a DOCTYPE to the iframe by loading full HTML content in RadEditor.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top