Esempio n. 1
0
        public static string GetProviderPathByName(string sitemapName)
        {
            string rtnElem = null;

            try
            {
                SitemapProviderConfiguration provider = GetProviderByName(sitemapName);
                rtnElem = provider.SitemapStores[0].Parameters.Get("path");
            }
            catch (Exception ex)
            {
                log.ErrorFormat("Error when retrieving Path in Sitemap Provider Configuration for {0}.", sitemapName);
                throw ex;
            }

            return(rtnElem);
        }
Esempio n. 2
0
        public static SitemapProviderConfiguration GetProviderByName(string sitemapName)
        {
            SitemapProviderConfiguration rtnElem = null;

            try
            {
                SitemapIndexSection section = (SitemapIndexSection)ConfigurationManager.GetSection(sitemapIndexSection);
                SitemapIndexProviderConfiguration indexConfig = section.Sitemaps;
                rtnElem = indexConfig[sitemapName + ".xml"];
            }
            catch (Exception ex)
            {
                log.ErrorFormat("Error when retrieving Sitemap Provider Configuration for {0}.", sitemapName);
                throw ex;
            }

            return(rtnElem);
        }