This is probably explained more easily with an example. I’m trying to find a way of turning a relative URL, e.g. ‘/Foo.aspx’ or ‘~/Foo.aspx’ into a full URL, e.g. http://localhost/Foo.aspx. That way when I deploy to test or stage, where the domain under which the site runs is different, I will get http://test/Foo.aspx and http://stage/Foo.aspx.
Any ideas?
Have a play with this (modified from here)