A call to the following context sensitive MapPath function does exactly what the documentation says it does.
It returns the physical file path that corresponds to the specified virtual path on the Web server. But this isn’t always what you want as it works on the current context which may be a web form running in a sub-directory of the main website.
In this case the solution is simple. Use the following code to map the path to a physical path on the server