I have an asp.net url path which is being generated in a web form, and is coming out something like ‘/foo/bar/../bar/path.aspx’, and is coming out in the generated html like this too. It should be shortened to ‘/foo/bar/path.aspx’.
Path.Combine didn’t fix it. Is there a function to clean this path up?
You could create a helper class which wrapped the UriBuilder class in System.Net
which could then be used like this:
It is a bit hacky but it would work for the specific example you gave.
EDIT: Updated to reflect Andrew’s comments.