Reputation: 2504
How do you resolve a url like "../../images/test.png" to "http://yoursite.com/images/test.png" in a static asp.net web method?
Upvotes: 3
Views: 5224
Reputation: 746
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;
Upvotes: 0
Reputation: 13230
Here is a blog entry from Rick Strahl that might help: http://www.west-wind.com/weblog/posts/154812.aspx
Upvotes: 8