I have the following models
public class Person
{
public string Name { get; set; }
public IList<Phone> PhoneNumbers { get; set; }
}
public class Phone
{
public string Number { get; set; }
}
Suppose I have the following Action :
public ActionResult Edit()
{
Person p = new Person
{
Name = "John K.",
PhoneNumbers = new List<Phone>
{
new Phone {Number = "555-555-5555"},
new Phone {Number = "555-123-4444"}
}
};
return View(p);
}
I would like the view to allow the user to add/delete/modify the phone numbers.
I searched a lot for a simple solution... I can't believe that kind of scenario which occurs often can't be handle easily...