急!Controller中如何取listbox一共选中了几项。以及选中了哪些值。急
<td>@html.ListBox("DownFileName",Model.DownFileName,New{Multiple = "multiple"})<td>
Controller的方法中怎么得到选啊了Listbox几项以用哪几项。
[HttpPost]
public ActionResult Gener(FormCollection form)
{
.....
}
------解决方案--------------------循环,
for (int i = 0; i < ListBox1.Items.Count; i++)
{
if (ListBox1.Items[i].Selected == true)
{
//用个什么东西存下来
}
}