I’m using MVC4.
Some code (that I can’t get into here) is generating the form on the fly, so I have absolutely no idea what fields are posted back to my MVC controller.
Here’s my Java:
var formData = $("#MyForm").serialize();
$.post('/mycontroler/postdata', formData, function (data) {
});
My problem is, how do I read this in MVC?
If I use…
Public Function postdata(data As String) As JsonResult
End Function
… the “data” variable is nothing.
So how do I read the querystring?
You could modify your postdata function as such:
then iterate over the fields and retrieve value(s)