Passing unstructured JSON between jQuery and MVC Controller Actions

后端 未结 2 1638
刺人心
刺人心 2021-01-23 23:11

There is quite a lot of helpful information on MVC model binding. My problem stems from the fact that I am trying to avoid creating strongly typed data in my MVC application as

2条回答
  •  佛祖请我去吃肉
    2021-01-23 23:41

    Not exactly what you're after but maybe the resolution of this issue would give you a partial workaround, by allowing you to bind to a simple wrapper object with an embedded Dictionary. It might even allow binding direct to a Dictionary. Not sure... You might also need to explicitly set the json ContentType header in your $.ajax call

    "JSON model binding for IDictionary<> in ASP.NET MVC/WebAPI"

提交回复
热议问题