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

Reading special characters

4 Answers 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Omlac
Top achievements
Rank 1
Omlac asked on 22 Sep 2008, 10:02 AM
good day all
Im trying to read the string below into a radeditor control, my problem is its not reading the \n\n characters. Its writing everything in one line without the breaks.
Does anyone know whats wrong. radEdt.content = mystring, where mystring has the value below.

Dear <Auditor First Name>\n\nYou have new audits assigned to you. Please login and schedule these audits.\n \nThese audits have the following special instructions:\n\r\n<Scheduled Audit Special Instructions>\n\nIf you have any questions please contact me on the above email address.\n\nRegards,\n \r\n \n<User First Name> <User Last Name>\r\n"

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 23 Sep 2008, 11:31 AM
Hi Omlac,

RadEditor is an HTML/XHTML editor and it does not understand the newline symbols /n/n used by the plain text editors, because they are not valid HTML tags. In order to fix the problem you should replace on the server the /n/n symbols with <br /><br /> tags using for example the String.Replace method, e.g.

RadEditor.Content = mystring.Replace("\n", "<br>").Replace("\r", "")

Best wishes,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Omlac
Top achievements
Rank 1
answered on 23 Sep 2008, 12:24 PM
Thank you very much,
Can i add images aswell to my content and save to a database without having to save html.

Regards
0
Rumen
Telerik team
answered on 23 Sep 2008, 02:26 PM
Hi Omlac,

RadEditor can load, edit and export only HTML / XHTML content. The HTML tags are strings, but the images are other type of content and they should be uploaded and saved separately. If you would like to save the images to a database then my suggestion is to implement a db file browser content provider. You can find more information in the following live example DB File Browser Content Provider and help article: Custom FileBrowserContent Provider.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Omlac
Top achievements
Rank 1
answered on 26 Sep 2008, 08:33 AM
Thank you very much
Tags
Editor
Asked by
Omlac
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Omlac
Top achievements
Rank 1
Share this question
or