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

RadEditor Content Property

2 Answers 174 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Adhelp
Top achievements
Rank 1
Adhelp asked on 04 Oct 2012, 06:42 PM
I have a web site that stores documentation.  We use RadEditor to add and update our documents.  I'm in the process of converting all my pages from .NET 1.1  to .NET 4.0

As a result I'm using a newer version of RadEditor.

Our documentation is actually stored as html in a SQL database.

When we display a document, we read the SQL DB into an XML doc and display it.

I have RadEditor working just fine to add new documents.  However, I'm having problems with editing documents.

When I retrieve my data from the SQL database, I'm loading the .InnerXML of my XML doc in the the RadEditor Content field.  RadEditor starts up in Design mode, but the main window is showing all the HTML markup - how can I load my data, so that the main window shows my rendered document, with the HTML markup in the lower window only?

Basically, I need to make this new version of RadEditor function the way my old RadEditor 7.3.5 did.  I've uploaded some files to illustrate my problem. 

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 09 Oct 2012, 01:12 PM
Hi,

My suggestions is to replace the &lt; and &gt; entities with < and > respectively before you load such tags in RadEditor. Once you do that the tags will be rendered in the content area in Design mode.


All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Adhelp
Top achievements
Rank 1
answered on 09 Oct 2012, 05:49 PM
Thank you!

That was a great hint...

Not being all that experienced with working with xmlDocument classes in VB.NET, my next challenge was how to do as you suggested.

I did note that in my old code I assigned the RadEditor from my xmlDocument's InnerText field.  My new code, as it was being upgraded to .NET 4.0 could no longer do that - I had to switch over to using XPATHNavigators and it only provided me with an InnerXML field.

What I finally figured out was to create an XMLDocumentFragment from the section of my XMLDoc that contained the "body" of my document that I needed to load into the editor.

The XMLDocumentFragment class DOES have an InnetText field, and when I assigned that into the RadEditor Content field, everything displayed as I expected to.

A learning experience all around!

Thank you for your help!
Tags
Editor
Asked by
Adhelp
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Adhelp
Top achievements
Rank 1
Share this question
or