For my site, I have a list of users and a list of events. I will be assigning users to each event. I have a table named EventUsers to hold this data:
------------------------
EventUsers
------------------------
EventID | UserID
------------------------
1 | 123
1 | 456
2 | 789
On my page, I want to be able to add and remove users for a certain event.
I could have a dropdown populated with users and an "Add" button next to it, then when I want to add a user, I pick one and click "Add". There would be a grid below it displaying all the users for the event, with "Delete" buttons for each one. The downside to this is that a database call is made for every Add and Delete.
Another option is to have two listboxes on the page - one on the left containing all users in the database, and another on the right which will contain users for the given event, and I can just add or remove from the list on the right. Then when I'm done, I click save, and it makes one database call. The only issue is that if I'm removing and adding, I'll have to delete every record in my EventUsers table for that event, and then add the changes.
I've run into this before, and I've always gone with the dropdown method. What's the preferred method here?