contentblock
Hi,
I have the following code, that I am using to find contenblocks in a page. But I am not sure how to get the content from the contentblock.
PageManager pageManager = PageManager.GetManager();
IQueryable<PageData> pages = pageManager.GetPageDataList();
foreach (PageData page in pages)
foreach (var c in page.Controls)
var ctrl = pageManager.LoadControl(c);
if (ctrl is ContentBlock)
//get content
Thanks,
Annie
Hello Annie,
The ContentBlock control has a property Html that you can operate with directly or use:
var htmlProperty = item.GetProperties(culture,
false
).SingleOrDefault(p => p.Name ==
"Html"
;