I have controller which gets list of keys and i want to pass them to another controller action:
public class DocumentController : Controller
{
private List<DocumentKey> _keys = new List<DocumentKey>();
[HttpPost]
public ActionResult Send(Document doc, IEnumerable<HttpPostedFileBase> file)
{
...
_keys = getKeys();
return RedirectToAction("Status", "Home", _keys);
}
i try to use
return RedirectToAction("Status", "Home", _keys);
and
return RedirectToAction("Status", "Home", new {keys = _keys});
But in Status keys is always null or has count = 0.
public class HomeController : Controller
{
public ActionResult Status(List<DocumentKey> keys)
{
return View(keys);
}
I can pass simple data, for example:
return RedirectToAction("Status", "Home", new {key = _keys.First().ToString()});
public ActionResult Status(string key)
this works, but is there a way to pass collection ?