Created
October 31, 2013 15:31
-
-
Save csharpforevermore/7251734 to your computer and use it in GitHub Desktop.
C# ASP.NET - get the absolute URL from a relative one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string relativeUrl = "/home"; | |
string returnValue = string.Format("{0}://{1}{2}{3}", current.Scheme, current.Host, | |
current.Port == 80 ? "" : ":" + current.Port, relativeUrl) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment