I've a Person entity that contains set of "Education" entities. What I want is to collect "N" number of Education entries from the form. This "N" is controlled by "Add More Education Information" and "Remove Education Information" buttons.
At the beginning there's an empty form that'll collect one Education entry. ("person" object , which is stored in session, has one empty education entity initially, and I call View with this "person" object)
If user clicks "Add More Education Information" button, then another form is added (to get another education information, i.e. from another university, or another degree) [I add another education object to "person" and call view(person) again]
This works ok, but old data is lost. Better to say data in the forms is not mapped to Education entities and is lost, even if I call TryUpdateModel(person). Everytime I click "Add More Education Information" button all previously entered data is lost, and all forms become empty.
Question: Is there a better way of solving this kind of problems(dynamically changing number of forms)? Or what should I change to preserve old data?
Thanks.
I hope I could explain my problem.