Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a proof-of-concept application that calls the ContentService to save documents to my Umbraco site.
The document type has a single custom generic property of type rich text editor.
Using my code that calls the ContentService, I can create a document and save it, but any html markup included in the content is stripped when saved.
I've Googled this pretty hard, and while I've found others with the same question/problem, I've not found any answers.
Can I save html markup with my content? How?
For reference, here's the code snippet used in my proof of concept:
public void Publish(string Content, string title) { var cs = ApplicationContext.Current.Services.ContentService; var page = cs.CreateContent(title, 1050, "RegularContent", 0); page.SetValue("pageText", Content); cs.SaveAndPublishWithStatus(page); }
I think you need to change your content to be of the type IHtmlString and then it will work.
Dave
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Saving HTML markup with content created with content service
I have a proof-of-concept application that calls the ContentService to save documents to my Umbraco site.
The document type has a single custom generic property of type rich text editor.
Using my code that calls the ContentService, I can create a document and save it, but any html markup included in the content is stripped when saved.
I've Googled this pretty hard, and while I've found others with the same question/problem, I've not found any answers.
Can I save html markup with my content? How?
For reference, here's the code snippet used in my proof of concept:
I think you need to change your content to be of the type IHtmlString and then it will work.
Dave
is working on a reply...