-
Categories
- ASP.NET (2)
- C# (4)
- Development (1)
- Kentico CMS (1)
- LINQ (1)
- SharePoint 2010 (7)
- Tools (1)
Dev Links
Category Archive: Kentico CMS
Subcategories: No categories
Retrieving Editable Regions in Kentico
Problem : Retrieve contents of editable regions in Kentico
Kentico CMS allows you to use a custom control called CMSEditableRegion. There are times when you might need to check the contents of this region and perform some checks to implement business rules.
Solution : Check for the EditableRegion property on the Current document
Each document has a property called EditableRegions which is basically a key value pair. If an editable region is on the page then the name (in lower case) is stored as a key in Editable Regions.
if (CMSContext.CurrentDocument.DocumentContent.EditableRegions.ContainsKey("uxpagetitle"))
{
content = CMSContext.CurrentDocument.DocumentContent.EditableRegions["uxpagetitle"].ToString();
}