ASP.NET: urls in plain html files can't find app root
A client I'm working with insists on including a plain-jane html file in the开发者_Python百科 ASP.NET app and I can't get the link urls to work properly. Here's an example:
<li><a class="nav_history2" href="/history.html">History</a></li>
It finds the server root (as I expect) but how to modify it to respect the app root? I'm looking for an equivalent to the ~. The client has tried ../ but claims it still finds the root. How is that possible? What SHOULD it look like please?
I don't have the ability to run it on his prod server, so I can't see the problem directly.
----- Edit -----
If I follow the suggestions given in the first two answers it will work if I turn the html page into an aspx, but so far not in the raw html file.
If I remember correctly, you just need to make ASP.NET actively aware of the tag, and the ~ symbol will work. Try:
<a class="nav_history2" runat="server" href="~/history.html">
精彩评论