protected void RefreshButtonClick()
        {
            var sh = new SitemapHandler();
            sh.RefreshSitemap(this, new EventArgs());

            IEnumerable<SiteConfigurationDto> sites = SitemapManagerConfiguration.GetSites();
            var sb = new StringBuilder();

            const string messageTemplate =
                "The sitemap of site '<b>{0}</b>' has been refreshed filename '<b>{1}</b><br />'";

            foreach (SiteConfigurationDto siteDto in sites)
            {
                sb.AppendFormat(messageTemplate, siteDto.Name, siteDto.FileName);
            }

            if (SitemapManagerConfiguration.ShouldGenerateRobotsTxt)
            {
                sb.Append("And added to robots txt");
            }

            Message.Text = sb.ToString();

            RefreshPanel("MainPanel");
        }
        protected void RefreshButtonClick()
        {
            var sh = new SitemapHandler();
            sh.RefreshSitemap(this, new EventArgs());

            StringDictionary sites = SitemapManagerConfiguration.GetSites();
            StringBuilder sb = new StringBuilder();
            foreach (string sitemapFile in sites.Values)
            {
                if (sb.Length > 0)
                    sb.Append(", ");
                sb.Append(sitemapFile);
            }

            string message = string.Format(" - The sitemap file <b>\"{0}\"</b> has been refreshed<br /> - <b>\"{0}\"</b> has been registered to \"robots.txt\"", sb.ToString());

            Message.Text = message;

            RefreshPanel("MainPanel");
        }
Example #3
0
        protected void RefreshButtonClick()
        {
            var sh = new SitemapHandler();

            sh.RefreshSitemap(this, new EventArgs());

            var sites = SitemapManagerConfiguration.GetSites();
            var sb    = new StringBuilder();

            foreach (string sitemapFile in sites.Values)
            {
                if (sb.Length > 0)
                {
                    sb.Append(", ");
                }
                sb.Append(sitemapFile);
            }

            Message.Text = $" - The sitemap file <b>\"{sb}\"</b> has been refreshed<br /> - <b>\"{sb}\"</b> has been registered to \"robots.txt\"";

            RefreshPanel("MainPanel");
        }