I have a set of PartialView that are dynamicaly changed in a page. A PartialView loads the next and so on using ajax. One of them have a form of like 20 inputs, currently I'm just sending one input but how can I send the rest of them? I have this in this partialview:
var shipping= $("input[name='shipping']:checked").val()
$.ajax(
{
url: '/Home/Payment',
type: "POST",
data: { 'shipping': shipping},
success: function (data) {
$("#cart").html(data);
}
});
And this in the controller:
public ActionResult Payment(string shipping)
{
**do stuff*
return PartialView("NextPartialView");
}
The controller recieves every input of the form but as I said before there are 20 of them. Is there a way to keep the code clean and readable using another technique to send the data?
I'm new in MVC and razor
Thanks