I am new to ASP.NET MVC and need some help. I have a need to create a form where the form is dynamically created. For example let's say I have a model named Person. The Person has a first and last name. In the form I want to allow the user to enter the first and last name of the person. I know how to do that, but what I don't know how to do is allow the user to add multiple persons and make that a single form submission.
On the initial load of the page (view) it would by default show two empty textboxes (for first name and last name). I would also have an add button that would allow the user to add another row to the form and show the same 2 textboxes for the 2nd person. Now if the user submits it, it would have 2 textboxes for the first name and 2 for the last name.
I don't know if there is a way to do this without post backs. Or is posting back my only option?
EDIT: Forgot to mention I am using the Razor engine.
Thanks