I have this method AddSection
public ActionResult AddSection(string code, ArrayList added)
{
ArrayList list = added;
if (list == null) list = new ArrayList();
list.Add(Request["selected_section"]);
return RedirectToAction("Details", new { code = code, added = list });
}
Which redirects to the Details:
public ActionResult Details(string code, ArrayList added)
{
if (added == null) added = new ArrayList();
return View(added);
}
Now in the Details action(if it’s rendered from the AddSection) the “added” ArrayList should never be null because it’s initialized anyway in AddSection and passed to the Details.
When I debug the program “added” ArrayList in Details is null even if the action rendered after AddSection.
Can someone explain why?
Like LukeP said, it looks like a dup because as the other question/answer states, only the primitive types can be passed, not complex types.
To modify your code you can do this