3
public ActionResult DoSomething()
{
return View("Index", new IndexModel { Foo = new List<string>() { "*" });
}
其中Index.cshtml具有包含@Html.HiddenFor(m => m.Foo)
存储在隐藏字段列表导致怪异的结果
public ActionResult ProcessForm(IndexModel model)
{
}
的ProcessForm里面你model.Foo表格包含一个字符串内容如下:
System.Collections.Generic.List`1[System.String]
我很迷茫......
我可能会转换成JSON,而不是,但你的答案不幸的是有道理.. *叹* – 2011-03-03 23:16:23
为什么不只是使用string.Join(“,”,列表)? – Matt 2012-03-19 09:58:50
已经过去了一年,但如果我没有记错的话,你不想传递null或空值。如果加入将这样做,我同意它会更简单。 – neontapir 2012-03-22 22:30:44