rtf tostring

3 posts, 0 answers
  1. Marco Teodoro
    Marco Teodoro avatar
    53 posts
    Member since:
    Apr 2010

    Posted 19 Oct 2011 Link to this post

    ;Hello,

    I need to get a rtf text from a SQL field and convert it to a normal string.

    after this i will convert it again to xml and send it by a soap service.

    i'm using the rad editor control to convert from rtf to string using the  following code:

    var entity= _container.someting.First();
     
              Telerik.Web.UI.RadEditor editor = new Telerik.Web.UI.RadEditor();
     
              editor.LoadRtfContent(entity.rtfText);
     
              var text = editor.Content.ToString();

    But the variable text have html values.... i was expecting pure text content.

    Is there a way to convert rtf to normal text?

    Best Regards,
    Marco



  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 20 Oct 2011 Link to this post

    Hello Marco,

    Replace the RadEditor's Content property with Text, which should return plain text only.

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marco Teodoro
    Marco Teodoro avatar
    53 posts
    Member since:
    Apr 2010

    Posted 20 Oct 2011 Link to this post

    thks...

    that's what we call unnecessary question :)

    Best Regards
Back to Top