Update document

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

Update an existing document

 

[C#]

 

// tree provider

CMS.TreeEngine.TreeProvider provider = new CMS.TreeEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);

// get document with specified site, alias path and culture

CMS.TreeEngine.TreeNode node = provider.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName, "/News/MyFirstNews", "en-us");

 

if (node != null)

{

  // change some values

  node.SetValue("NewsSummary", "Some changed summary.");

  node.SetValue("NewsText", "Some changed text.");

  // Update the document

  node.Update();

}

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?update_document.htm