Getting full URL from URL with tilde(~) sign

Try out

System.Web.VirtualPathUtility.ToAbsolute("yourRelativePath"); 

There are various ways that are available in ASP.NET that we can use to resolve relative paths to a resource on the server-side and making it available on the client-side. I know of 4 ways –

 1) Request.ApplicationPath
 2) System.Web.VirtualPathUtility
 3) Page.ResolveUrl
 4) Page.ResolveClientUrl

Good article : Different approaches for resolving URLs in ASP.NET

Leave a Comment