For one of my projects I need to allow the user to select some products out of a table. This table will be paged (+2k records in DB).
So the user needs to be able to select items on different pages without losing them. I was thinking about using 2 tables. One table to select items from and another table(also with paging) where the selected items will be displayed.
But I have no idea how to persist the selected items without using Sessions... If anybody has a better idea please share it.
Edit: It is possible(won't happen that much) to select all products (+2k records). I don't know how mvc will behave if you have 2k hidden fields. Also lets say i use hidden fields and have the following in my viewmodel
public List<int> SelectedIds {get;set;}
I can then use hidden fields with "SelectedIds[i]" as name(replacing i by an integer). But the user can also deselect the items again. And I don't think the binding will work when you skip numbers. ex: 2 hidden field with these names "SelectedIds[0]" && "SelectedIds[2]"
This is something I'll have to test when i am home...