this is the class to create my json object
public class RootObject
{
public string name { get; set; }
public string id { get; set; }
public string school { get; set; }
public List<object> details{ get; set; }
}
this is the way I'm creating a new object
var obj = new RootObject();
obj.name= "test";
obj.id = "null";
obj.school = "something else";
Then I am serializing the object using JavaScriptSerializer (this is working fine) I need to add an array to this list of object "details" to get something like this:
{
"name ":"test",
"id":null,
"school ":"something else",
"details":["details1","detail2"]
}
I tried to add as string or element by element but without success. How can I solve this?