0

I have a Javascript library that passes a dictionary in the post data like this:

sort[columnName] = asc

If I do something like:

[HttpPost]
public ContentResult tableData(Dictionary<string,string> sort)

It doesn't parse it. Do I need to parse this by hand? Or is there a way?

I'm Sure this question has been asked before but due to the syntax it seems impossible to find.

Harmlezz
  • 7,972
  • 27
  • 35
Paul Perrick
  • 496
  • 9
  • 22
  • Have you tried parameter as `Dictionary sort`? – Lali Mar 16 '17 at 08:05
  • You can always try with dynamic object and see if the problem is really in mapping/parsing. – Stoyan Petkov Mar 16 '17 at 08:08
  • The issue is that it needs to be a dictionary: sort[UserName]=asc&sort[Phone]=desc If there are multiple keys, I need them. – Paul Perrick Mar 16 '17 at 13:31
  • Nevermind, found it. I am passing the parameters correctly and I do have the right format for the dictionary so there must be something completely different that is out somewhere. So this question is moot. http://stackoverflow.com/a/18683004/881954 – Paul Perrick Mar 17 '17 at 12:49

1 Answers1

0

Never mind, found it. I am passing the parameters correctly and I do have the right format for the dictionary so there must be something completely different that is out somewhere. So this question is moot. stackoverflow.com/a/18683004/881954

Paul Perrick
  • 496
  • 9
  • 22