/// <summary> /// Method to load themes in the left panel /// </summary> private void LoadThemes() { try { StateManager stateManager = StateManager.Instance; MiscellaneousController objMisc = new MiscellaneousController(); string strPath = ""; if (Request.RawUrl.Contains("/")) { strPath = Request.RawUrl.ToString().Substring(0, Request.RawUrl.ToString().LastIndexOf('/')); strPath = strPath.Substring(strPath.LastIndexOf('/') + 1); } if ((strPath != "") && (Request.QueryString["Type"] != null)) { objTribute.TributeUrl = strPath; objTribute.TypeDescription = Request.QueryString["Type"].ToString().ToLower().Replace("newbaby", "new baby"); objTribute = objMisc.GetTributeSessionForUrlAndType(objTribute, WebConfig.ApplicationType.ToString()); } if (objTribute != null) { if (objTribute.TributeId > 0) { _tributeId = objTribute.TributeId; _tributeName = objTribute.TributeName; _tributeType = objTribute.TypeDescription; _tributeUrl = objTribute.TributeUrl; } } Templates objTributeType = new Templates(); objTributeType.TributeType = _tributeType; // "Wedding"; int existingTheme = GetExistingTheme().TemplateID; MiscellaneousController _controller = new MiscellaneousController(); List<Templates> lstThemes = _controller.GetThemesFolderList(objTributeType, WebConfig.ApplicationType); StringBuilder sbChangeSiteTheme = new StringBuilder(); foreach (Templates objThemes in lstThemes) { sbChangeSiteTheme.Append("<div class='yt-Form-Field yt-Form-Field-Radio' id='" + objThemes.ThemeCssClass + "'>"); // + objThemes.TemplateName.Remove(objThemes.TemplateName.IndexOf(" "), 1) + "'>"); sbChangeSiteTheme.Append("<input name='rdoTheme' type='radio' runat='server' id='rdo" + objThemes.TemplateID + "' onclick='javascript:Themer(\"" + objThemes.ThemeValue + "\");GetSelectedTheme(" + objThemes.TemplateID + ",\"" + objThemes.ThemeValue + "\");' value='" + objThemes.ThemeValue + "'"); string appPath = string.Empty; if (WebConfig.ApplicationMode.ToLower().Equals("local")) { appPath = WebConfig.AppBaseDomain; } else { appPath = string.Format("{0}{1}{2}", "http://www.", WebConfig.TopLevelDomain, "/"); } if (hdnSelectedTheme.Value != string.Empty) { if (int.Parse(hdnSelectedTheme.Value) == objThemes.TemplateID) { sbChangeSiteTheme.Append(" Checked='Checked' />"); idSheet.Href = appPath + "assets/themes/" + objThemes.FolderName + "/theme.css"; //to set the selected theme } else sbChangeSiteTheme.Append(" />"); } else { if (existingTheme == objThemes.TemplateID) { sbChangeSiteTheme.Append(" Checked='Checked' />"); idSheet.Href = appPath + "assets/themes/" + objThemes.FolderName + "/theme.css"; //to set the selected theme } else sbChangeSiteTheme.Append(" />"); } sbChangeSiteTheme.Append("<label for='rdo" + objThemes.TemplateID + "'>"); //rdo" + objThemes.TemplateName + "'>"); sbChangeSiteTheme.Append(objThemes.TemplateName + " <span class='yt-ThemeColorPrimary'></span><span class='yt-ThemeColorSecondary'></span></label>"); sbChangeSiteTheme.Append("</div>"); } litThemes.Text = sbChangeSiteTheme.ToString(); stateManager.Add("ThemeOnMaster", lstThemes, StateManager.State.Session); } catch (Exception ex) { throw ex; } }