It is common knowledge amond .NET developers that the control class has a handy method called ResolveUrl() which resolves a path containing the tilde (~) charachter to an application specific absolute path.
I often want to use this facility when I am working in code not in a class that inherits from Control. In this case there is another option using the VirtualPathUtility library.
Using the static method VirtualPathUtility.ToAbsolute("~/my-url-here.aspx") will give exactly the same results as ResolveUrl() for when you are not working from within a control.