private void FillLayouts() { string pageType = "Community"; if (community.ProfileOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity")) { pageType = "Profile"; } else if (community.ProfileOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("Page")) { pageType = "Page"; } object layoutsDataTable = Cache.Get(string.Format("Create{0}WizardDTLayouts_{1}", pageType, udc.UserRole.ToUpper())); if (layoutsDataTable != null) { dtLayouts = (DataTable)layoutsDataTable; } else { dtLayouts = new DataTable("Layouts"); dtLayouts.Columns.Add("LayoutName", typeof(string)); dtLayouts.Columns.Add("LayoutText", typeof(string)); var layouts = Layouts.GetLayouts(); foreach (var layout in layouts) { if ((layout.Roles == "*" || layout.Roles.ToUpper().Contains(udc.UserRole.ToUpper())) && (layout.PageTypes == "*" || layout.PageTypes.ToUpper().Contains(pageType.ToUpper()))) { DataRow drLayout = dtLayouts.NewRow(); drLayout["LayoutName"] = layout.Name; drLayout["LayoutText"] = string.Format("<div style='margin-top:5px;'><img src='/App_Layouts/{0}/icon.gif'/></div>", layout.Name); dtLayouts.Rows.Add(drLayout); } } Cache.Insert(string.Format("Create{0}WizardDTLayouts_{1}", pageType, udc.UserRole.ToUpper()), dtLayouts); } rblLayouts.DataSource = dtLayouts.DefaultView; rblLayouts.DataTextField = "LayoutText"; rblLayouts.DataValueField = "LayoutName"; rblLayouts.DataBind(); if (rblLayouts.Items.Count > 0) { rblLayouts.SelectedIndex = 0; originalLayout = rblLayouts.SelectedValue; } }