public string GetLocalPath(string href) { string result; string applicationPath = PathParser.GetApplicationPath(httpContext.Request); if (href.StartsWith("/") == false && applicationPath.EndsWith("/") == false) { result = applicationPath + "/" + href; } if (href.StartsWith("/") && applicationPath.EndsWith("/")) { result = applicationPath + href.Substring(1); } else { result = applicationPath + href; } return(result); }