I've seen this question posted a couple other times on SO, but not in quite the same context as mine. So I apologize if this is a re-post.
I have the following complex object:
public class UserProfile
{
public Education education { get; set; }
// 3 other properties irrelevant to question b/c not able to be updated
}
The Education class looks like this:
public class Education
{
public List<Certification> certifications { get; set; }
public List<Degree> degrees { get; set; }
}
And the Certification class looks like this:
public class Certification
{
public int yearCertified { get; set; }
public DateTime expirationDate { get; set; }
}
The Degree class looks similar to the Certification class. On my Edit (Update) view page for their User Profile, I allow the user to dynamically add as many Degrees and Certifications as he/she wants. This means that I'd like to POST a list of Certification and Degree objects to the Update method in my controller.
I know posting simple objects is easy with MVC, but trying to post a complex object for an Update, especially with a List of other objects, is a little more tricky.
Can anyone help me with what my View and Controller should look like? I'm using MVC 1.0.
Thank you.