带参数System.Type

时间:2016-06-22 14:28:21

标签: c# model-view-controller system.type

我有以下行动方法

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。

这甚至可能吗?

0 个答案:

没有答案