BALA MUKUND
Top achievements
Rank 1
BALA MUKUND
asked on 23 Mar 2010, 01:37 AM
Hello,
I am using the RAD Editor to post articles. We would like the HTML formatting to be retained. But when we save it to the database the HTML tags are converted to blocks
e.g. <BR /> is converted to [BR/] which causes the formatting to be completely lost.
Can anyone please assist?
Thanks
Bala
6 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 23 Mar 2010, 10:38 AM
Hi Bala,
Please check the demo link below.You need to pass the Content property value of the RadEditor instead of the Text property
http://demos.telerik.com/aspnet-ajax/editor/examples/saveindatabase/defaultcs.aspx
Shinu
Please check the demo link below.You need to pass the Content property value of the RadEditor instead of the Text property
http://demos.telerik.com/aspnet-ajax/editor/examples/saveindatabase/defaultcs.aspx
Shinu
0
BALA MUKUND
Top achievements
Rank 1
answered on 23 Mar 2010, 02:28 PM
Thanks for your response - how can I accomplish the same from the client side (using javascript)?
Thanks
Bala
0
Hi Bala,
Greetings,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I am not quite sure that I understand your scenario. By default, RadEditor has two properties:
Could you please provide more detailed information on the subject? How do you implement that HTML tag conversion?
- Text - returns the content of the RadEditor without the HTML tags
- Content - returns the full content of the RadEditor with the HTML
If you want to avoid using CodeBehind you can check the following help article:
Codeless Save In Database ASP.Net 2.0
You can also get the editor's content on the client using the get_html(true) method.
Greetings,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
BALA MUKUND
Top achievements
Rank 1
answered on 29 Mar 2010, 03:00 PM
Thanks guys. I was able to resolve the issue using the get_html function.
Thanks once again.
Bala
Thanks once again.
Bala
0
Virendra Shinde
Top achievements
Rank 1
answered on 05 Apr 2010, 10:50 PM
Hello,
I have the same issue but I would like the save the spacing, newlines, tabs when I use radeditor.text. is there any Way.
Thanks
-Virendra
I have the same issue but I would like the save the spacing, newlines, tabs when I use radeditor.text. is there any Way.
Thanks
-Virendra
0
Hello Virendra,
Formatting can be stripped automatically on page submit using the OnClientSubmit event and FormatStripper command of RadEditor. Here is how to strip all formatting except the new lines, e.g.
<script type="text/javascript">
function OnClientSubmit(editor)
{
editor.fire("FormatStripper", {value : "
}
</script>
<telerik:RadEditor runat="server" OnClientSubmit="OnClientSubmit"/>
After that you should obtain the editor's content on the server through the Content property (not the Text one).
Greetings,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Formatting can be stripped automatically on page submit using the OnClientSubmit event and FormatStripper command of RadEditor. Here is how to strip all formatting except the new lines, e.g.
<script type="text/javascript">
function OnClientSubmit(editor)
{
editor.fire("FormatStripper", {value : "
ALL_NO_BRAKES
"}); }
</script>
<telerik:RadEditor runat="server" OnClientSubmit="OnClientSubmit"/>
After that you should obtain the editor's content on the server through the Content property (not the Text one).
Greetings,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.