Question

My project (named Viper) seems to be working fine in debug mode on my dev PC.

The following line

<a href="@Url.Action("Index", "Setup")">Setup</a>

gives me the following link in the browser in dev, which works fine:

http://localhost/Viper/Setup

However, when I release this to the staging pc, when I look at the same link, I get this:

http://setup

Any idea why the release mode isn't capturing the virtual path?

Was it helpful?

Solution

why not use

@Html.ActionLink("Setup", "Index", "Setup")

if you need the relativa path you can use

@Url.Content("~/")

so in your case

<a href="@Url.Content("~/" + Url.Action("Index","Setup"))" >Setup</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top