I have just deployed an MVC4 .NET 4.0 app to my web host, for 'live' deployed testing. Non -area routes are working fine, e.g. my
@Html.ActionLink("Register as a Client", "Register", "Account", new { registrationType = "Client"}, null)
link works fine, and the link opens the correct page. However, with a link to an area based action like this:
@Html.ActionLink("Authors", "Index", "Home", new { Area = "Author", registrationType = "Author" }, null)
the link actually rendered to the browser is missing action and controller, i.e.
http://mylivedomain.com/?Area=Author®istrationType=Author
It may be worth noting that the css bundling feature of MVC4 was not working after deployment, and I rolled back to using classic style links to individual stylesheets.
MAYBE RELATED: My question: Why is unmodified template code in my MVC4 app trying to register areas twice?
JUST IN: Removing the default action from the area route mappings for the default rouite solved this problem. There was no default controller to start with, in the VS2012 template code.
new{}
at the end of your ActionLink()? #2036805 – Politicnull
instead, and this works for me on my dev machine, and worked before on the previous, MVC3, version of my site that I'm deploying. – Pyrosis