How do I know the the complete virtual path that my application is currently hosted? For example:
http://www.mysite.com/myApp
or
Try this (Haven't tried it)
public string GetVirtualPath(string physicalPath) { string rootpath = Server.MapPath("~/"); physicalPath = physicalPath.Replace(rootpath, ""); physicalPath = physicalPath.Replace("\\", "/"); return "~/" + physicalPath; }
Link 1
Link 2