How do I Bind a Collection (IEnumerable) of a custom type?
问题 I have the following Action to display a form with 3 items : [HttpGet] public ActionResult ReferAFriend() { List<ReferAFriendModel> friends = new List<ReferAFriendModel>(); ReferAFriendModel f1 = new ReferAFriendModel(); ReferAFriendModel f2 = new ReferAFriendModel(); ReferAFriendModel f3 = new ReferAFriendModel(); friends.Add(f1); friends.Add(f2); friends.Add(f3); return View(friends); } and then a Post action [HttpPost] public ActionResult ReferAFriend(IEnumerable<ReferAFriendModel> friends