This is my DisputeController method stub:
[HttpPost]
public virtual ActionResult UpdateDisputeStatus(DisputeUdpateStatusModel model)
{//some code
Here is my Ajax call:
var url = '/dispute/UpdateDisputeStatus';
var disputeStatusObj = {
DisputeId: id,
DisputeStatusId: selectedValue
}
$.ajax({
url: url,
cache: false,
type: 'POST',
contentType: "application/json; charset=utf-8",
data: disputeStatusObj,
success: function (data) {
alert('Status Changed Successfully');
},
error: function (e) {
alert('Error: ' + e.status);
}
});
I know the routing works, as without using the data parameter the code enters my method (obviously without the model in parameters)
I have tried the following data formats:
data: {'DisputeId': DisputeId, 'StatusId': DisputeStatusId},
data: {disputeStatusObj},
data: JSON.Stringify(disputeStatusObj)
using controller methods:
[HttpPost]
public virtual ActionResult UpdateDisputeStatus(string disputeId, string statusId)
[HttpPost]
public virtual ActionResult UpdateDisputeStatus(modelname model)
None of which work. I get Not found errors or 500's.
Bearing in mind that I know the routing is correct, when I send the request with no data, so what am I missing here?
Am I declaring the controller incorrectly?

data: JSON.Stringify(disputeStatusObj)with the original action should workpublic virtual ActionResult UpdateDisputeStatus([FromBody] DisputeUdpateStatusModel model)contentType: "application/json; charset=utf-8",option (you are not stringifying the data, so use the default)' public class DisputeUdpateStatusModel { public DisputeUdpateStatusModel(string disputeId, string statusId) { DisputeId = disputeId; StatusId = statusId; } public string DisputeId { get; set; } public string StatusId { get; set; } }... very confused as to why it is so hard to send data in Ajax to MVC