Get Absolute path from relative path without using tilde (~)

I hope it is not at all needed to explain how to get absolute path with tilde(~), but sometimes we may need to get absolute path without using tilde(~). Lemme tell you when, its when you pass path in a query string to some URL. At that time you wont get absolute path using tilde(~).

At that time you need to use HttpRuntime.AppDomainAppVirtualPath instead of tilde(~). Simple concat HttpRuntime.AppDomainAppVirtualPath  + path.

Simple huh !

Leave a comment