我有一個形式帖子幾個像命名的元素,像這樣的動作:麻煩重定向的String []
<%= Html.TextBox("foo") %>
<%= Html.TextBox("foo") %>
<%= Html.TextBox("foo") %>
職位,並返回:
public ActionResult GetValues(string[] foo)
{
//code
return RedirectToAction("Results", new { foo = foo })
}
「結果」行動,那麼外觀像這樣:
public ActionResult Results(string[] foo)
{
//code
return View()
}
我遇到的問題是,後重定向我的網址是這樣的:
/results?foo=System.String[]
而不是預期的:
/results?foo=value&foo=value&foo=value
有沒有什麼辦法讓這個與我目前的設置工作?
對不起,延遲響應...這沒有幫助。只是爲了澄清,我沒有任何問題獲取表單值綁定到一個字符串[]或IEnumerable ...我有問題,當我調用RedirectToAction並傳遞它的字符串[]或IEnumerable。 – 2009-11-29 04:47:32