I am trying to get a typical asp.net url starting with the tilde sign (‘~’) to parse into a full exact url starting with “http:”
I have this string “~/PageB.aspx”
And i want to make it become “http://myServer.com/PageB.aspx“
I know there is several methods to parse urls and get different paths of server and application and such. I have tried several but not gotten the result i want.
If you’re in a page handler you could always use the
ResolveUrlmethod to convert the relative path to a server specific path. But if you want the “http://www.yourserver.se” part aswell, you’ll have to prepend theRequest.Url.SchemeandRequest.Url.Authorityto it.