The reply at
MVC3 Pass Model view to controller using javascript
implies that this was impossible, at least for MVC 3.
I was wondering if there is any way in MVC 4 to quickly pass the entire form contents (represented by the model) from the .cshtml (razor) view to the controller in JavaScript.
For example, if I select a dropdown, I may want to return all fields from a form to the controller which will take appropriate action.
Obviously, for large forms it is undesirable to have to do this element-by-element
JSON
,AJAX
,Serialization
,JsonNET
, etc? Actually, you don't pass anything. You submit information to anAction
in theController
. – melancia