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

[Solved] Loading text from db into RadEditor

3 Answers 269 Views
Editor
This is a migrated thread and some comments may be shown as answers.
MWM
Top achievements
Rank 1
MWM asked on 24 Mar 2008, 01:07 PM
I'm new to using the RadEditor.  Currently, I use a simple textbox control to edit the "text" fields from my db (SQL Server).

I'd like to move into using the RadEditor in order to be able to have clickable URLs and text formatting.

I'm having trouble getting my text from the db into the RadEditor on an aspx page. 

Can someone steer me in the right direction?  I tried setting:

RadEditor1.text = "something" (which was really my db field's value)

but I received an error that this "text" property is "read-only".  This method works fine for the textbox control.  My intution was wrong about the RadEditor's property apparently.

I'd like to set whatever code/properties necessary in the code-behind so if you could offer that in your response, I'd appreciate it.

Thanks for any assistance!

Mark

3 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 24 Mar 2008, 01:47 PM
Hello MWM,

The property to use is Content.
The Text property strips HTML all formatting from the RadEditor content and returns it as plain text.
For more information please refer to the following online demo:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/Examples/SettingContent/DefaultCS.aspx

Kind regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
MWM
Top achievements
Rank 1
answered on 24 Mar 2008, 10:34 PM
Thank you for your reply.

I looked at that example.  It's helpful, but one question...

There doesn't appear to be a closing tag for the "scriptmanager".  I had used the "radscriptmanager", but removed it and replaced it with a "scriptmanager" after seeing your example.  Both tags use a closing tag.

Since the example has no closing tag (that I can see), I'm unsure whether to surround the radEditor with this tag or not.  Can you assist further?

Thanks,

Mark
0
Tervel
Telerik team
answered on 25 Mar 2008, 08:09 AM
Hi MWM,

The ScriptManager does have an implicit closing tag.

This:
 <asp:ScriptManager id="ScriptManager" runat="server"/>

is equivalent to this:
 <asp:ScriptManager id="ScriptManager" runat="server"></asp:ScriptManager>


Regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
MWM
Top achievements
Rank 1
Answers by
Tervel
Telerik team
MWM
Top achievements
Rank 1
Share this question
or