From bad665d8f6701be327754b40ec4787a693b3b64e Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Mon, 23 Sep 2013 19:58:05 +0700 Subject: [PATCH] Fixes #222, index page links are broken in sub-application. --- .../MvcSiteMapProvider/Web/Mvc/XmlSiteMapResult.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/XmlSiteMapResult.cs b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/XmlSiteMapResult.cs index e8b1d299..579790aa 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/XmlSiteMapResult.cs +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/XmlSiteMapResult.cs @@ -228,7 +228,7 @@ protected virtual IEnumerable GenerateSiteMapIndexElements(int numPage // Generate elements for (int i = 1; i <= numPages; i++) { - var combinedPath = urlPath.Combine(urlPath.AppDomainAppVirtualPath, siteMapUrlTemplate.Replace("{page}", i.ToString())); + var combinedPath = urlPath.Combine(urlPath.AppDomainAppVirtualPath, "~/" + siteMapUrlTemplate.Replace("{page}", i.ToString())); var pageUrl = baseUrl + urlPath.MakeVirtualPathAppAbsolute(combinedPath); yield return new XElement(Ns + "sitemap", new XElement(Ns + "loc", pageUrl)); }