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!!!