Click here to Skip to main content
15,113,873 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hi.
I am making a website wherein there are various folders in which the web forms are placed.
I am not getting the correct way to get the root directory path. Also, there are some script files which are common to all pages but they cant get the correct path of the file's location.
eg. When a page is called which is in User/ folder in the root from Info/ folder, the server tries to search for the User folder in the Info folder.

So I want some way to get the root directory path directly. Have tried Server.MapPath("") but it returns the current Virtual path address and not the root path.

Please help!!.. :confused:
Posted

Tried Server.MapPath("~")?
   
Before you get more confused, read this article - There is something about "Paths" for Asp.net beginners[^]. There is a comment[^] below the article which summarizes it very well.

I hope that will clear your doubts about the 'paths'.

Cheers!
Ankur
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900