MVC3 Models with repeating fields

How do you handle views that are strongly typed to models with repeating fields in MVC3? I would like to use the standard MVC3 methods of validation and use the HTML helper methods for generating inputs but have had to fall back on hand coding the inputs in HTML and using FormCollection for params in the controller method.

The representation of the email[] field in the view is basically a repeating text input (the user can click a button to add a new field). For existing emails (update view) it needs to pass the id and the address string. I have this working but it doesn't feel right at all.

public class Email
    public int EmailId
    public string EmailAddress

public class Person
    public int PersonId;
    [Required(ErrorMessage = "First name is required")]
    public string FirstName;
    [Required(ErrorMessage = "Last name is required")]
    public string LastName;

    // how to handle this?
    public Email[] EmailAddresses;


This can be a really lengthy post how to accomplish this. But there are several blogs that discuss how this can be done:



Need Your Help

What is faster: web service or XML server output?

c# .net xml web-services

The Central Bank of Russia as any other central bank provides a service to get exchange rates between ruble a number of other world currencies.