When using the MapPath method in my code I recieve the following error:
“Cannot use a leading .. to exit above the top directory.”
This error is cause when you use lines similar to :
CnxStr = myPage.MapPath(“../folder1/”)
The security restrictions of ASP.NET do not allow you to use “..” to move up above the root of the application as defined in IIS. You can correct this error with one of the following :
You can use the physical path directly as opposed to the mappath method.
alternatively you can use :
Server.MapPath(“/app/folder”) & “..\..\..\files\”