I'am trying to create a Publishing Page with HTML content inside.
The Web in what i try to create the page has both radEditor features(
RadEditorFeatureRichHtml and RadEditorFeatureRichText) activated.
My code looks like that.
|1||PublishingPage currentPage = ......; |
|2||SPFile spFile = currentPage.ListItem.File; |
|3||SPListItem fileItem = spFile.Item; |
|4||fileItem[FieldId.PublishingPageContent] = htmlContent; |
The Html content starts for example with that:
|1||<table class ="testClass" cellspacing="0" cellpadding="0" border="0"> |
After the update() method is called the saved output looks like
||<table class =testClass cellspacing=0 cellpadding=0 border=0>
Also comments like
<!-- comment -->
I've discovered serveral ways to get the content into the field. I even put the content through filestream into the
field but sharepoint always strips the characters.I also tried to Encode the content but this also not worked.
If I call the RadEditor through the graphical interface and set the EditModes to HTML and then paste my html code it works fine and the content is saved in the correct form. I thought if your editor is able to save html content without stripping, there must be a way to save it through the api.
Please tell me if there are any possibilities to save the content through the API.
Thanks and greets Torsten