Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • wizardnet 3 posts 22 karma points
    Jan 11, 2014 @ 11:54
    wizardnet
    0

    Html markup not saved in Umbraco 7

    Hi everyone!

    I've developing some method via inheriting from **UmbracoApiController** class.

    my problem is when I try to save some html string to content editor like "<b>some</b>", then in the Umbraco-UI I get <p>some</p>, Meaning: the text is saved but without his markup html. - So I need to save with html markup.

    I search on Google and in this lovely forum but I not found any solution!

    Please help! :)

     

    This is the code (content is simple rich editor typed field from umbraco):

            // Get the Umbraco Content Service

                var contentService = Services.ContentService;

                var Page = contentService.CreateContent(

                    tip.Name, // the name of the product

                    tipPage, // the parent id should be the id of the group node 

                    "content", // the alias of the product Document Type

                    0);

     

                var k = new System.Web.HtmlString(tip.Text); // tip.Text = "&lt;...."

     

                Page.SetValue("content", "<b>some</b>");// k is NOT WORKING Either);

     

                // finally we need to save and publish it (which also saves the product!) - that's done via the Content Service

                contentService.SaveAndPublishWithStatus(Page);

Please Sign in or register to post replies

Write your reply to:

Draft