Skip to main content
added 180 characters in body; added 27 characters in body; added 17 characters in body; added 1 characters in body; added 54 characters in body
Source Link
zad
  • 3.4k
  • 2
  • 26
  • 25

You just need to serialize the instance of MyObject. Serializer will automatically serialize the inner lists accordingly.

If you need to ignore any property use the [ScriptIgnore] atribute like russau suggested.

eg.

public class MySubObject
{
 // The JavaScriptSerializer ignores this field.
        [ScriptIgnore]
        public int useID { get; set; }
}

You just need to serialize the instance of MyObject. Serializer will automatically serialize the inner lists accordingly

You just need to serialize the instance of MyObject. Serializer will automatically serialize the inner lists accordingly.

If you need to ignore any property use the [ScriptIgnore] atribute like russau suggested.

eg.

public class MySubObject
{
 // The JavaScriptSerializer ignores this field.
        [ScriptIgnore]
        public int useID { get; set; }
}
Source Link
zad
  • 3.4k
  • 2
  • 26
  • 25

You just need to serialize the instance of MyObject. Serializer will automatically serialize the inner lists accordingly