When I run my project on my machine, it runs on http://localhost:53998/
but when I deploy it to http://test.myserver.com/MyApp/
all links break. I'm using the relative path tilde (~
), so a navigation link would be something like:
<a href="~/SomeCtrl/Index">Some Action</a>
On localhost, this works fine (when root is /
), but when I deploy my project under /MyApp/
it links the action to http://test.myserver.com/SomeCtrl/Index
instead of http://test.myserver.com/MyApp/SomeCtrl/Index
so I always get a 404.
Isn't this what the tilde (~
) should take care of? Am I doing something wrong here?
EDIT:
This works correctly:
@Html.ActionLink("Some Action", "Index", "SomeCtrl")
And this:
<a href="@Url.Action("Index", "SomeCtrl")">Some Action</a>