开发者

ResolveUrl in Static WebMethod

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜