I’m missing something here. This is my controller method
public void SubmitSweep(int personID, int DD, int MM, int YYYY, int hh, int mm, int dealId)
This is my button def
<button id="submit@(person.Id)" class="btn btn-secondary" OnClick="submitSweep(@(person.Id), @(person.sweepDay), @(person.sweepMonth), @(person.sweepYear), @(person.sweepHour), @(person.sweepMinutes), @(person.dealId))">Submit Sweep</button>
This is my JS function
function submitSweep(thePersonID, sweepDay, sweepMonth, sweepYear, sweepHours, sweepMinutes, theDealId) {
$.ajax({
type: 'POST',
url: '@Url.Action("SubmitSweep", "Home")',
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify({ personID: thePersonID, DD: sweepDay, MM: sweepMonth, YYYY: sweepYear, hh: sweepHours, mm: sweepMinutes, dealId: theDealId }),
success: function (data) {
alert("Success");
},
error: function (ob, errStr) {
alert("An error occured.Please try after sometime." + errStr + " " + ob.responseText);
}
});
}
The function is being hit and the arguments are populated. I’ve hacked around and determined that the issue is with the AJAX data field. If I have no arguments in the controller, I get to my break point, so confident the error is in my data line.
I’m running VS 2022, sp mostly newer libraries I guess.
Any help or pointers would be immensely appreciated.
Cheers
J