http://localhost:55201/SERVICES/customers/CALLME
如何使用@ Html.ActionLink链接
服务是RouteArea,客户是RoutePrefix,客户是控制器
@ Html.ActionLink(“点击我”,“ CallMe”,新建{area =“ Services”}) 这个代码对吗?其返回的空白锚点。
[RouteArea("Services")]
[RoutePrefix("Customers")]
public class CustomerController : Controller
{
[Route("~/Test")]
public ActionResult Index()
{
ViewBag.Controller = "Customer";
ViewBag.Action = "Index";
return View("ActionName");
}
[Route("CallMe")]
public string CallMeFunction()
{
return string.Format("CallMeFunction() invoked");
}
}