How to create fully qualified URLs.NET Tip of The Day.org

With ASP.NET it’s quite easy to get absolute path to a page by calling the VirtualPathUtility.ToAbsolute method. Getting absolute URL is not that obvious but still quite easy. Just combine request url with absolute path to your ASP.NET page:

string absolutePath = VirtualPathUtility.ToAbsolute(“http://dotnettipoftheday.org/test/MyWebForm.aspx”);

Uri newUri = new Uri(Request.Url, absolutePath);

WP Like Button Plugin by Free WordPress Templates