<div class="row"> <form action="/SubmitRequest"> <table> <tbody> <tr> <td> String </td> <td> <input name="string1" type="text" /> </td> </tr> <tr> <td> String 2 </td> <td> <input name="string2" type="text" /> </td> </tr> <tr> <td> Bool Val </td> <td> <input name="chk1" type="checkbox" /> </td> </tr> </tbody> </table> </form>
When my form executes, it needs to hit a controller such as:
[HttpPost] public IActionResult SubmitRequest(ViewModel vm) { //do things return View(); }
I have access to the jquery libraries, and I believe I need to post json data back. How can I do this? The ViewModel is a 1:1 match of the objects (string String, string String2, bool Chk1, all required).