when I deserialize to list of object it work but when I deserialize to a object with list type it errors out. Any idea how to make it work?
page name: testjson.aspx
I would suggest doing something like this:
People persons = new People(new JavaScriptSerializer().Deserialize<IList<Person>>(json));
and changing your constructor to this:
public People(IEnumerable<Person> collection) : base(collection)
{
}
You don't have to worry about messy casts between types, and it works just as well since your People class has a base constructor that takes in an IEnumberable.