How do you开发者_如何学编程 resolve a url like "../../images/test.png" to "http://yoursite.com/images/test.png" in a static asp.net web method?
Here is a blog entry from Rick Strahl that might help: http://www.west-wind.com/weblog/posts/154812.aspx
look in HttpContext.Current.Request
I was able to use the current Context and application paths together:
Uri uri = new Uri(HttpContext.Current.Request.Url,
System.IO.Path.Combine(HttpContext.Current.Request.ApplicationPath,
"Reports/CareerDev.aspx"));
return uri.AbsoluteUri;
精彩评论