Virtual path
1)The virtual path provider system is a method of raising the layer of abstraction when it comes to ASP.NET and the file system.
2)This virtual path provider system is primarily driven by three abstract classes in the System.Web.Hosting namespace, VirtualPathProvider, VirtualFile, and VirtualDirectory.
3)Virtual file system can contain any file in the web application other than
1) Binaries
2) Web.config
3) Global.asax
4)Files in special folder such as App_Data and so on
4)ASP.NET the "~" tilde indicates the root of a virtual path. We need the tilde because otherwise ASP.NET can't figure out if a path is absolute or relative.
Virtual paths
~/App_Data/Sample.xml
~/
~/Map.txt
Physical paths
C:\Website\Files\Sample.xml
C:\Website\Default.aspx
C:\Website\Map.txt
5)The domain name part of the path is not really a property of the application itself, but depends on the requesting URL. You might be able to reach a single Web site from many different host names. To get the domain name associated with the current request, along with the virtual path of the current application, you could do:
Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath
Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator