public void ApplyTemplate(string templateName) { TemplateController.ActivateTemplate(templateName, 1); TemplateController.UpdateConfigPages(); ltrMessages.Text = "<span class='messagearea'>Your template has been changed succesfully. We are preparing your site. Please have some patience for a few minutes. </span>"; UpdateAppSettingValue("templatechoosed", "true"); UpdateAppSettingValue("issiteconfigured", "true"); Config.Touch(); }
public static void ActivateTemplate(string TemplateName, int PortalID) { ClearOptimizationCache(PortalID); string optimized_path = HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedResourcePath); IOHelper.DeleteDirectoryFiles(optimized_path, ".js,.css"); if (File.Exists(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedCssMap))) { DeleteNodes(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedCssMap), "resourcemaps/resourcemap"); } if (File.Exists(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedJsMap))) { DeleteNodes(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedJsMap), "resourcemap/resourcemap"); } TemplateController.ActivateTemplate(TemplateName, PortalID); }