我有以下行动方法
public PartialViewResult AddToBasket(int id, Type type)
{
_basketService.AddToBasket(id, type);
return UpdateBasket();
}
在我的一个剃刀视图中,我正在渲染像这样的链接
@Ajax.ActionLink("Add Box To Basket", "AddToBasket", "Basket", new {id = box.Id, type = typeof(BasketBox)}, new AjaxOptions {UpdateTargetId = "basket", OnSuccess = "showPopover();"}, new {})
这会呈现像这样的链接
http://localhost:37913/Public/Basket/AddToBasket/241415?type=MyProject.Shared.Repository.Models.BasketBox
但是,当调用AddToBasket
时,我的type参数始终为null。
这甚至可能吗?