First question!
Environment
MVC, C#, AppHarbor.
Problem
I am calling an openid provider,
I recently ran into an issue where I compared a URL to the current URL, and then highlighted navigation based on that. It worked locally, but not in production.
I had http://example.com/path/to/file.aspx
as my file, but when viewing that file and running Request.Url.ToString()
it produced https://example.com:81/path/to/file.aspx
in a load balanced production environment.
Now I am using Request.Url.AbsolutePath
to just give me /path/to/file.aspx
, thus ignoring the schema, hostname, and port numbers.
When I need to compare it to the URL on each navigation item I used:
New Uri(theLink.Href).AbsolutePath