I am using the Editor as an email template editor. The users have the ability to create html or plain text emails. The problem is when I use the .Text property I am not getting the carriage returns or line feeds. Is there a different property I need to be using or setting just to get plain text?
2 Answers, 1 is accepted
0
Accepted
Tervel
Telerik team
answered on 23 Mar 2009, 05:24 PM
Hi Ryan,
The Text property would strip all HTML tags. It will, however, correctly convert <br> and <p> tags into \n symbols.
This means that in fact new lines are retained - and if you subsequently load the content from the editor into a <textarea> element, you will notice that the new lines are there.
However, if you set this Text content back to an editor using its Content property, certainly these \n symbols will not cause new lines to appear into the editor - because the \n symbol has no meaning in HTML. To have new lines you need to run code such as string.Replace("\n", "<br>");
In all occasions, make sure that your "email consumer" - be it again RadEditor or some HTML email client such as Outlook does receive HTML that has <br> tags. Else you will not see new lines.
Best regards,
Tervel
the Telerik team
Check out
Telerik Trainer
, the state of the art learning tool for Telerik products.