i have multiple websites on the same server. I want to have a link from one to another but i can’t seem to have relative paths because it seems that Server.MapPath cant go “below” the root of the current website.
how do i have one website on my machine point to a file or page that is on another one.
Maybe creating a virtual will help solve this. I’m not really sure what you are trying to do.
You can create a virtual path on your website that is mapped to another physical path on your machine (i.e another website)
How To Create a Virtual Directory in Internet Information Services (IIS)
Then when you use MapPath to access this virtual you can access another website.
Update:
@me: You can do to IIS and create a virtual directory to access the other application. From your first application you would create an ‘Application2’ virtual and point it to C:\inetpub\wwwroot\website2.
Now when you access http://www.mywebsite.com/Application2 you are looking at files in the other application (C:\inetpub\wwwroot\website2).
Also, a Server.MapPath(“./Application2”) will return the path in C:\inetpub\wwwroot\website2\
I hope that helps.