59,931 views 127 on YTPak
149 4

Published on 07 Nov 2012 | over 4 years ago

Text version of the video
csharp-video-tutorials.blogspot.com/2012/11/mapping-virtual-path-to-physical-path_6.html

Slides
csharp-video-tutorials.blogspot.com/2013/08/part-20-servermappath-example.html

All ASP .NET Text Articles
csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

All ASP .NET Slides
csharp-video-tutorials.blogspot.com/p/aspnet-slides.html

All Dot Net and SQL Server Tutorials in English
www.youtube.com/user/kudvenkat/playlists

All Dot Net and SQL Server Tutorials in Arabic
www.youtube.com/c/KudvenkatArabic/playlists

In this video we will learn about the Practical use of Server.MapPath() method with an example.

Tilde(~) symbol resolves to the root application directory, no matter how deep you are in the folder hierarchy. This is the advantage of using ~(tilde), over ..(2 Dots). The following code would work from any folder in our application.
DS.ReadXml(Server.MapPath("~/Data/Countries/Countries.xml"));

Where as, the following code will only work from folders, that are 2 levels deeper relative to the root directory of the application.
DS.ReadXml(Server.MapPath("../../Data/Countries/Countries.xml"));

Loading related videos...