我有一个字符串数组,我需要在Url.Action的查询字符串中传递。带有字符串数组的URL.Action?
Url.Action("Index", "Resource", new { FormatIds = Model.FormatIDs})
现在,链接在我的浏览器中显示为System.String []而不是查询字符串。有没有可能让MVC通过模型绑定自动执行此操作?
我需要用它来像我控制器操作绑定:
public ActionResult Index(string[] formatIDs)
你期望输出看起来像什么? –
我需要它与我的控制器动作绑定,如下所示: public ActionResult Index(string [] formatIDs) – user547794
查询字符串通常不是执行此操作的最佳方法。 –