path of project

I have project that is a WEB site and not a WEB application.  A WEB site, since it is compiled on the fly, does not have a "My Project' folder and thus does not have access to the My.Application object.

So, I want to get the path of the root of my application.  I want to access custom text files that reside there as part of my app.  
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
strickddCommented:
Server.MapPath is what you want.

Server.MapPath("/MySiteFolder/Folder/")

Open in new window


The more specific the better, for example specify a filename at the end.
0
 
Mez4343Commented:
did you try
Application.StartupPath
0
 
HainKurtSr. System AnalystCommented:

try these...

Server.MapPath("/")
Server.MapPath("~")
Server.MapPath("~/")
Server.MapPath(".")

0
 
HLRosenbergerAuthor Commented:
That did the trick!  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.