Passing unstructured JSON between jQuery and MVC Controller Actions

后端 未结 2 1634
刺人心
刺人心 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条回答
  •  梦毁少年i
    2021-01-23 23:34

    You could use the serializeArray method. Let's suppose that you have a form containing the input elements which could be of any type and you want to invoke the following controller action:

    public ActionResult CaptureInput(Dictionary values)
    {
        ...
    }
    

    here's how you could proceed:

    
    

提交回复
热议问题