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

[Solved] A way to get unformatted content from the editor?

3 Answers 87 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tom M
Top achievements
Rank 1
Tom M asked on 10 Nov 2009, 08:18 PM
Is there an easy way to get unformatted HTML content from the editor? I am saving to a database don't want any tabs or spaces in there. I am looking for a way to do this without using a content filter and was wondering if there is some property that can facilitate this.

~Tom

3 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 10 Nov 2009, 08:44 PM
Are you looking for something like the get_html client-side function? It returns the content of the editor in its HTML form.
0
Tom M
Top achievements
Rank 1
answered on 10 Nov 2009, 09:25 PM
Thanks for the quick reply Schlurk.

I'm actually looking to do this server-side. Currently in my C# code I reference the editor content like this...

((RadEditor)e.Item.FindControl("EmailBodyEditor")).Content

I understand the usefulness of formatted HTML code while in "HTML" edit mode for readability, but I don't need the formatting in my database. Is there another way to reference the HTML content server-side so I can get the raw HTML?

~Tom

Update: It looks like the Editor is putiing Line feeds in there ( /r/n )... I guess a workaround would be to do a String.Replace to get rid of them...like in this thread http://www.telerik.com/community/forums/aspnet-ajax/editor/r-n-being-added-to-content-when-submitted.aspx
0
Rumen
Telerik team
answered on 13 Nov 2009, 09:45 AM
Hello Tom,

Yes, the solution provided in the forum post is the way to achieve your scenario. This information is available in this KB article: "\r\n" being added to content when submitted.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Tom M
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Tom M
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or