I have read many articles on relative / absolute paths, but I still can not understand this problem.
The following code is presented on my ASP.NET page Master:
<li><a>Reports</a>
<ul>
<li>
<a href="/Reports/One.aspx">One</a>
</li>
<li>
<a href="~/Reports/Two.aspx">Two</a>
</li>
</ul>
</li>
(Note that one link has ~, and the other does not.)
When the site starts, the first link points to http://server/Reports/One.aspx, and the second link points to http://server/company/project/Reports/~/Reports/Two.aspx.
How do I get to the root of my ASP.NET project without ignoring which virtual directories are configured on IIS?
source
share