+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / SetMetaData is not working with a custom metadata

SetMetaData is not working with a custom metadata

2 posts, 1 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    28 Jul 2010
    Link to this post
    I have set the metadata on the web.config.
    <add key="News.Feature" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="0"/>

    Setting the value directly on the database and retrieving on the code works just fine.

    But my problem is that when I try to do the following

    var manager = new ContentManager("News");
    var content = manager.GetContent(id);
     
    content.SetMetaData("Feature", 1);

    It gets the right content, do the SetMetaData, finishes the method but doesn't change the database.
    Doing a GetMetaData right after it returns 1, and in the database it is still 0.

    I am using it in a webservice method.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Jul 2010
    Link to this post
    Hello Bruno Michels,

    You should call SaveContent method.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered