I am serializing my form to be sent back to the server where it auto binds to a view model. However want to send 2 more parameters to the server but not sure how
public ActionResult Test(MyViewModel vm, DateTime date, bool isSomething)
I am not sure how my "data" parameter in my ajax call should look like
data: { 'vm': frm, 'date': date, 'isSomething': true }, // this does not work.
Normally I would have just done this
data: frm,
My code complies and no javascript errors however it appends 'vm' to all of the frm ones and then on the server it does not know how to bind it. Basically the json key is messing up the binding.
When I do
data: frm // result of items look like this Id 7b97dcc7-3f8d-4cc0-ad2a-a104010f683d
when I do
data: {'vm' : frm} // result looks like this vm[0][name] Id
some how I have to send it so it does need a key.