I have the following code snippet:
string tmp = String.Format(\"
You can use the UriBuilder and set the value of the port to -1
and the code will be like this:
Uri tmpUri = new Uri("http://LocalHost:443/Account/Index"); UriBuilder builder = new UriBuilder(tmpUri); builder.Port = -1; Uri newUri = builder.Uri;