'Passing popullated list of integers to action resulting in null list

I have this list:

List<int> _orgIDs = db.OrgBizTypes.Where(orgBT => biztypeIds.Contains(orgBT.BizTypeId)).Select(u => u.OrgId).ToList();

If I stick in a breakpoint, I can see that _orgIDs has multiple records.

I then pass it to a new action here:

return RedirectToAction("Search", "Organization", new { OrgIds = _orgIDs });

And, at this point the _orgIDs is still populated with multiple records.

But then, when the action “Search” receives it, OrgIds is suddenly null:

public ActionResult Search(ManageMessageId? message, int? page, List<int> OrgIds)

I will admit that I’ve never passed a list like this, but it seems like it should work, no?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source