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

[Solved] Retrieve RadEditor Content!

1 Answer 50 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dev Team
Top achievements
Rank 2
Dev Team asked on 09 Apr 2008, 12:41 PM
Hi,
    I am using RAD Editor in SharePoint page for storing some html tag information. Every thing is working fine still. I tried to retrieve the page content programatically using the below code snippet,

using

(SPSite site = new SPSite(webContext.Site.Url))

{

using (SPWeb web = site.OpenWeb("SiteName"))

{

site.AllowUnsafeUpdates =

true;

web.AllowUnsafeUpdates =

true;

PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);

PublishingPageCollection pages = publishingWeb.GetPublishingPages();

splstItem = pages[

"/" + web.Name + "/pages/" + pageURL].ListItem;

pageContent = splstItem.Fields[

"Page Content"].GetFieldValueAsText(value = splstItem["Page Content"]);

pageContent = splstItem[

"Page Content"].ToString();

pageContent = HttpUtility.HtmlEncode(pageContent);

site.AllowUnsafeUpdates =

false;

web.AllowUnsafeUpdates =

false;

}

}

But this gives me, the encoded value of the text like,
<pre style="display:none" id=RadEditorEncodedTag>PGlmcmFtZSBzdHlsZT0iUEFERElORy1SSUdIVDogMnB4OyBQQURESU5HLUxFRlQ6IDJweCIgc3JjPSJodHRwOi8vc2VjdXJpdHk2LmNvbnRpbnVpdHlsb2dpYy5uZXQvX0NPTlRST0xURU1QTEFURVMvRWNtMzYwQ29udHJvbHMvUmVwb3J0cy9EaXNwbGF5UmVwb3J0U3RvcmUuYXNweD9pZD0xIiB3aWR0aD0iMTUwJSIgaGVpZ2h0PSIzMDAlIj48L2lmcmFtZT4=</pre>

Please guide me, how to get the proper value out of the editor content!!!

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 15 Apr 2008, 02:31 PM
Hi Sampras,

Indeed, the retrieved content is encoded. In order to decode it please use the following code:

pageContent  = Telerik.SharePoint.
EditorTools.UnEscapeSpecialTags(pageContent);

I hope this helps.

Best regards, George
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
Tags
RadEditor
Asked by
Dev Team
Top achievements
Rank 2
Answers by
George
Telerik team
Share this question
or