Monday, March 19, 2012

ASP.Net Absolute URL C#

    public static string GetUrl(string file, Page page)
    {
        string end = (page.Request.ApplicationPath.EndsWith("/")) ? "" : "/";
        string path = page.Request.ApplicationPath + end;
        return string.Format("http://{0}{1}{2}", page.Request.Url.Authority, path, file);
    }

Please visit: www.TyroDeveloper.com

Please Click on +1

No comments:

Post a Comment