T4MVC adding current page controller to action link
- by Mike Flynn
I have the following ActionLink that sits in the home page on the register controller (Index.cshtml)
@Html.ActionLink("terms of service", Url.Action(MVC.Home.Terms()), null, new { target="_blank" })
Generating the following URL. Why is "register" being added to it? It's as if the link within the Register page which has it's own controller is preappending the register controller to any link in that view?
http://localhost/register/terms-of-service
routes.MapRoute(
"Terms",
"terms-of-service",
new { controller = "Home", action = "Terms" }
);
public partial class HomeController : SiteController
{
public virtual ActionResult Terms()
{
return View(new SiteViewModel());
}