I want to save a javascript object of arrays into a dictionary with a list of string in C# through ajax. But I can't figure out the format needed for the object in javascript.
My javascript object is in the format:
{
"foo" : ["abc", "def", "ghi"],
"foo2": ["123", "456", "789"],
}
But the C# data member ends up holding an empty object.
I've also tried
[
{"foo" : ["abc", "def", "ghi"]},
{"foo2": ["123", "456", "789"]},
]
My C# datamember is
[DataMember]
public Dictionary<string, List<string>> theDictionary;
I have no trouble with saving list of strings or saving other simple javascript objects if I've created the corresponding C# class. Any idea what format is needed?