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

rtf tostring

2 Answers 61 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Marco Teodoro
Top achievements
Rank 1
Marco Teodoro asked on 19 Oct 2011, 06:05 PM
;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 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Oct 2011, 02:57 PM
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
0
Marco Teodoro
Top achievements
Rank 1
answered on 20 Oct 2011, 03:16 PM
thks...

that's what we call unnecessary question :)

Best Regards
Tags
Editor
Asked by
Marco Teodoro
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Marco Teodoro
Top achievements
Rank 1
Share this question
or