I have a website in ASP.NET MVC3. I want to pass collection to another view. I have this collection in ViewBag
. Here is my ActionLink
:
@Html.ActionLink("Show Report", "Report", new { workList = ViewBag.workReportList })
Controller:
public ActionResult Report(List<Work> workList)
{
return View(workList);
}
But it is not working - it looks like the passed object is empty.
When I am using the same object to RenderPartial
everything is working fine.
@{Html.RenderPartial("WorkListTable", (IEnumerable<WorkWeb.Entities.Work>)ViewBag.workReportList);}
How can I pass this object to a View? Any help much appreciated!