Hi there, From what I know, there is no public method like you say, however, you can write your own method. You first need to get the physical path of the application directory, then you can easily to convert a physical path to a virtual path. The sample code is something like this:
private string MapVirtualPath(string physicalPath)
{
string baseDir = HttpRuntime.AppDomainAppPath;
string virtualPath = "";
if(physicalPath.IndexOf(baseDir) >= 0)
{
string text1 = physicalPath.Substring(baseDir.Length);
text1 = text1.Replace("\\", "/");
virtualPath = HttpRuntime.AppDomainAppVirtualPath + "/" + text1;
}
return virtualPath;
}