Updating ContentBlock pulled from pageManager.LoadControl()
Is there a way to save a modified ContentBlock that I extracted from the LoadControl method? Here's what I have so far, and it doesn't seem to work sadly.
var pageManager = PageManager.GetManager();
foreach (var c in duplicated.Page.Controls)
// go through the properties, use the ID to grab the right text
foreach (var p in c.Properties)
if (p.Name == "ID")
var content = pageContent.Where(content_pair => content_pair.Key == p.Value).SingleOrDefault();
var control = pageManager.LoadControl(c);
if (control is ContentBlock)
ContentBlock contentBlock = (ContentBlock) control;
contentBlock.Html = content.Value;
pageManager.SaveChanges();