private string GetPageUrl(RequestContext requestContext, string path, bool retry)
        {
            string matchedUrl = null;

            foreach (var pathPart in path.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (PageRegistration.IsLocationRegistered(pathPart))
                {
                    matchedUrl = pathPart;
                    break;
                }
            }

            if (matchedUrl == null && !retry)
            {
                PageRegistration.LocatePages();
                matchedUrl = this.GetPageUrl(requestContext, path, true);
            }

            if (!retry)
            {
                PageRegistration.RegisterPage(requestContext.HttpContext, requestContext.RouteData, matchedUrl);
            }

            return(matchedUrl);
        }