I already have some webmethods receiving 1 or 2 parameters working successfully. What I want to do is sent a json string that can be deserialized into a datatable with multiple rows.
The string looks similar to this: [{"sectionID":12,"order":0},{"sectionID":21,"order":10},{"sectionID":20,"order":20},{"sectionID":22,"order":30},{"sectionID":23,"order":40},{"sectionID":24,"order":50},{"sectionID":25,"order":60}]
I tried to pass it as the the value, but that didn't work. data: {'jsonString:','[{"sectionID":12,"order":0},{"sectionID":21,"order":10},{"sectionID":20,"order":20},{"sectionID":22,"order":30},{"sectionID":23,"order":40},{"sectionID":24,"order":50},{"sectionID":25,"order":60}]'}
I got an error about Invalid object passed in. I then tried this type of method declaration as I saw somewhere: public static void updateSectionPositions(List sectionList) where SectionPosition is a class with 2 properties of sectionID and order. That gives me the same error.
Any ideas? The ultimate goal is to have this json string become a datatable that I can traverse on the c# side. Thanks.