我正在使用ASP.Net routing debugger。我的路线获得了匹配,但在“匹配当前请求”列中显示 false 。为什么会这样?
这是我当前的注册路线
routes.MapMvcAttributeRoutes(); //Enables Attribute Routing
routes.MapPageRoute("WebFormDefault", "", "~/Default.aspx");
routes.MapRoute(
name: "MvcDefault",
url: "{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional }
);
我的控制器路线属性
[HttpGet]
[ValidateInput(false)]
[Route("Summary/{id}", Name="GetSummary")]
public ActionResult GetSummary(int id)
{
// blah blah blah
return PartialView("_CardViewPartial", summaries);
}
查看剃刀
@model Models.DoorIndexPageModel
@{
Layout = "~/Views/Shared/_MVCPartialLayout.cshtml";
}
@Html.Action("GetSummary", new {Model.DisplayEmpId})