【发布时间】:2018-02-28 11:54:27
【问题描述】:
想象一个对象定义如下:
public class MyViewModel{
public List<string> MyList { get; set; }
}
在我看来,我有这个动作链接:
@Ajax.ActionLink("<", "Index", new MyViewModel() { MyList = new List<string>() {"foo", "bar"}}, new AjaxOptions())
ActionLink 的 html 结果将是:
<a class="btn btn-default" data-ajax="true" href="/Index?MyList=System.Collections.Generic.List%601%5BSystem.String%5D"><</a>
我的问题是,如何得到这个结果:
<a class="btn btn-default" data-ajax="true" href="/Index?MyList=foo&MyList=bar"><</a>
【问题讨论】:
标签: c# razor asp.net-mvc-5 html-helper