I have a supplier object, and each supplier has several contacts, on the page, has a tab for the supplier register, and another tab for the contact register, the contact register tab has a small form, and below one table where to every item registered in the form, I insert into the table using JavaScript. After this page has a tab filled with vendor data and on the other tab an HTML table with a contact list, I need to send this to controller to register with the bank.
In my View I use a ViewModel Like this:
public class FornecedorContatoViewModel
{
public Fornecedor Fornecedor { get; set; }
public Contato Contato { get; set; }
}
The form is made with razor, and the table is HTML itself.
In the controller, something like this would work:
public ActionResult Add(Fornecedor fornecedor, IList<Contato> contato)
{
}
And how to make the whole table go to the action in the form of a list (List in this case), how would the submit, would it do normally?